summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2013-03-24 01:37:21 +0000
committerderaadt <deraadt@openbsd.org>2013-03-24 01:37:21 +0000
commitca229a5cc81e8c29a180f1b3abc2ebf49b3efda5 (patch)
tree1cc8cdec83499e2f8062a63f292ce77cc0f9f728
parentpstats is already 0, but the bonus = 0 belongs outside the pointer section (diff)
downloadwireguard-openbsd-ca229a5cc81e8c29a180f1b3abc2ebf49b3efda5.tar.xz
wireguard-openbsd-ca229a5cc81e8c29a180f1b3abc2ebf49b3efda5.zip
dlerror() should not return const char *, as noted by landry
ok guenther
-rw-r--r--include/dlfcn.h4
-rw-r--r--lib/libc/dlfcn/dlfcn_stubs.c6
-rw-r--r--libexec/ld.so/dlfcn.c6
-rw-r--r--share/man/man3/dlfcn.36
4 files changed, 11 insertions, 11 deletions
diff --git a/include/dlfcn.h b/include/dlfcn.h
index c7758d04d48..76e3387acb4 100644
--- a/include/dlfcn.h
+++ b/include/dlfcn.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dlfcn.h,v 1.12 2012/10/01 00:21:19 guenther Exp $ */
+/* $OpenBSD: dlfcn.h,v 1.13 2013/03/24 01:37:21 deraadt Exp $ */
/* $NetBSD: dlfcn.h,v 1.2 1995/06/05 19:38:00 pk Exp $ */
/*
@@ -85,7 +85,7 @@ __BEGIN_DECLS
void *dlopen(const char *, int);
int dlclose(void *);
void *dlsym(void *__restrict, const char *__restrict);
-const char *dlerror(void);
+char *dlerror(void);
#if __BSD_VISIBLE
int dladdr(const void *, Dl_info *);
diff --git a/lib/libc/dlfcn/dlfcn_stubs.c b/lib/libc/dlfcn/dlfcn_stubs.c
index 6342afd8d49..af0dcc2c980 100644
--- a/lib/libc/dlfcn/dlfcn_stubs.c
+++ b/lib/libc/dlfcn/dlfcn_stubs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dlfcn_stubs.c,v 1.11 2009/04/22 07:15:15 guenther Exp $ */
+/* $OpenBSD: dlfcn_stubs.c,v 1.12 2013/03/24 01:37:23 deraadt Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -40,7 +40,7 @@ void *dlopen(const char *libname, int how) __attribute__((weak));
int dlclose(void *handle) __attribute__((weak));
void *dlsym(void *handle, const char *name) __attribute__((weak));
int dlctl(void *handle, int command, void *data) __attribute__((weak));
-const char * dlerror(void) __attribute__((weak));
+char *dlerror(void) __attribute__((weak));
struct dl_info;
int dladdr(const void *addr, struct dl_info *info) __attribute__((weak));
@@ -82,7 +82,7 @@ dlctl(void *handle, int command, void *data)
}
/*ARGSUSED*/
-const char *
+char *
dlerror(void)
{
return "Wrong dl symbols!\n";
diff --git a/libexec/ld.so/dlfcn.c b/libexec/ld.so/dlfcn.c
index 552df474f73..8ce0c12345f 100644
--- a/libexec/ld.so/dlfcn.c
+++ b/libexec/ld.so/dlfcn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dlfcn.c,v 1.87 2012/08/31 19:44:03 kettenis Exp $ */
+/* $OpenBSD: dlfcn.c,v 1.88 2013/03/24 01:37:23 deraadt Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -313,10 +313,10 @@ _dl_real_close(void *handle)
/*
* Return a character string describing the last dl... error occurred.
*/
-const char *
+char *
dlerror(void)
{
- const char *errmsg;
+ char *errmsg;
switch (_dl_errno) {
case 0: /* NO ERROR */
diff --git a/share/man/man3/dlfcn.3 b/share/man/man3/dlfcn.3
index 09a9df9f027..34ae378fcf1 100644
--- a/share/man/man3/dlfcn.3
+++ b/share/man/man3/dlfcn.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: dlfcn.3,v 1.23 2010/02/20 21:08:11 schwarze Exp $
+.\" $OpenBSD: dlfcn.3,v 1.24 2013/03/24 01:37:23 deraadt Exp $
.\" $NetBSD: dlfcn.3,v 1.3 1996/01/09 19:43:34 pk Exp $
.\"
.\" Copyright (c) 1995 Paul Kranenburg
@@ -29,7 +29,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: February 20 2010 $
+.Dd $Mdocdate: March 24 2013 $
.Dt DLFCN 3
.Os
.Sh NAME
@@ -52,7 +52,7 @@
.Fn dladdr "const void *addr" "Dl_info *info"
.Ft "int"
.Fn dlctl "void *handle" "int cmd" "void *data"
-.Ft "const char *"
+.Ft "char *"
.Fn dlerror "void"
.Sh DESCRIPTION
These functions provide an interface to the run-time linker