git: 93c14c55ec0d - main - libc: constify dummy error message string for dlfcn

Konstantin Belousov kib at FreeBSD.org
Fri Apr 9 20:47:09 UTC 2021


The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=93c14c55ec0da311dc09c1c8c1c7ecd5f2fae51a

commit 93c14c55ec0da311dc09c1c8c1c7ecd5f2fae51a
Author:     Konstantin Belousov <kib at FreeBSD.org>
AuthorDate: 2021-04-05 04:14:39 +0000
Commit:     Konstantin Belousov <kib at FreeBSD.org>
CommitDate: 2021-04-09 20:46:23 +0000

    libc: constify dummy error message string for dlfcn
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Differential revision:  https://reviews.freebsd.org/D29623
---
 lib/libc/gen/dlfcn.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/libc/gen/dlfcn.c b/lib/libc/gen/dlfcn.c
index 395a6d9402e8..6047f7ddd4d7 100644
--- a/lib/libc/gen/dlfcn.c
+++ b/lib/libc/gen/dlfcn.c
@@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$");
 #include "libc_private.h"
 #include "reentrant.h"
 
-static char sorry[] = "Service unavailable";
+static const char sorry[] = "Service unavailable";
 
 void _rtld_thread_init(void *);
 void _rtld_atfork_pre(int *);
@@ -91,7 +91,7 @@ char *
 dlerror(void)
 {
 
-	return (sorry);
+	return (__DECONST(char *, sorry));
 }
 
 #pragma weak dllockinit


More information about the dev-commits-src-all mailing list