From fb0dd050432c6e439618ebcabeab061733aa75bd Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 3 Jan 2001 04:50:22 +0000 Subject: Update. * manual/Makefile (TEXI2PDF): Change to texi2dvi --pdf. Suggested by Minko Markov . 2001-01-02 Franz Sirl * sysdeps/powerpc/elf/start.S (__data_start): Make it global. * sysdeps/powerpc/dl-machine.c (dl_reloc_overflow): Print the name of the failing symbol. (__process_machine_rela): Pass symbol to dl_reloc_overflow(). 2001-01-02 Ben Collins * time/tzset.c (tzset_internal): Make sure we fall back to UTC if TZ is not set and TZDEFAULT is not present. 2001-01-01 Ben Collins * string/strings.h: Make sure we declare our functions even if string.h is already included, based on whether or not __USE_BSD is defined. 2001-01-02 Ulrich Drepper * dlfcn/dlerror.c (dlerror): Handle call of dlerror() before any other dlopen() and dlsym(). Based on a patch by Ben Collins . 2001-01-02 Andreas Jaeger * dlfcn/errmsg1.c (main): Call dlerror initially. Reported by Ben Collins . 2001-01-02 Ulrich Drepper --- dlfcn/dlerror.c | 5 ++--- dlfcn/errmsg1.c | 6 ++++++ 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'dlfcn') diff --git a/dlfcn/dlerror.c b/dlfcn/dlerror.c index 6ce601d05b..59ee0b8c54 100644 --- a/dlfcn/dlerror.c +++ b/dlfcn/dlerror.c @@ -46,7 +46,7 @@ static void free_key_mem (void *mem); char * dlerror (void) { - char *buf; + char *buf = NULL; struct dl_action_result *result; /* Get error string. */ @@ -64,9 +64,8 @@ dlerror (void) free ((char *) result->errstring); result->errstring = NULL; } - buf = NULL; } - else + else if (result->errstring != NULL) { buf = (char *) result->errstring; if (__asprintf (&buf, result->errcode != 0 ? "%s: %s: %s" : "%s: %s", diff --git a/dlfcn/errmsg1.c b/dlfcn/errmsg1.c index a7bb9b8272..b455ea97a5 100644 --- a/dlfcn/errmsg1.c +++ b/dlfcn/errmsg1.c @@ -27,6 +27,12 @@ main (void) void *h; const char *s; + /* Test that dlerror works initially. */ + s = dlerror (); + printf ("dlerror() without prior dl*() call returned: %s\n", s); + if (s != NULL) + return 1; + h = dlopen ("errmsg1mod.so", RTLD_NOW); if (h != NULL) { -- cgit v1.2.3