]> sourceware.org Git - glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Sat, 10 Jun 2000 04:06:58 +0000 (04:06 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sat, 10 Jun 2000 04:06:58 +0000 (04:06 +0000)
* dlfcn/dlerror.c (struct dl_action_result): Add objname member.
(dlerror): Add objname to asprintf() parameters.
(_dl_error_run): Pass new parameter to _dl_catch_error.

ChangeLog
dlfcn/dlerror.c

index aae57faa2d30c09d7e1968dc7a011227ad434043..e41d9a41a7b679585c1616385769c7be52883a20 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,9 @@
        place pointed to.
        * include/dlfcn.h: Adjust _dl_catch_error prototype.
        * sysdeps/generic/ldsodefs.h: Adjust _dl_signal_error prototype.
+       * dlfcn/dlerror.c (struct dl_action_result): Add objname member.
+       (dlerror): Add objname to asprintf() parameters.
+       (_dl_error_run): Pass new parameter to _dl_catch_error.
        * elf/dl-libc.c (dlerror_run): Pass new parameter to _dl_catch_error.
        * elf/dl-open.c (_dl_open): Likewise.
        * elf/rtld.c (dl_main): Likewise.
index b4ffde5fdfe2521ccdd854a89a62bebcbbb79c43..972a9ac263f95bf30079b7cb74e144d1812b63b3 100644 (file)
@@ -1,5 +1,5 @@
 /* Return error detail for failing <dlfcn.h> functions.
-   Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1995, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #include <dlfcn.h>
+#include <libintl.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -28,7 +29,8 @@ struct dl_action_result
   {
     int errcode;
     int returned;
-    char *errstring;
+    const char *objname;
+    const char *errstring;
   };
 static struct dl_action_result last_result;
 static struct dl_action_result *static_buf;
@@ -59,20 +61,21 @@ dlerror (void)
       /* We can now free the string.  */
       if (result->errstring != NULL)
        {
-         free (result->errstring);
+         free ((char *) result->errstring);
          result->errstring = NULL;
        }
       buf = NULL;
     }
   else
     {
-      buf = result->errstring;
+      buf = (char *) result->errstring;
       if (result->errcode != 0
-         && __asprintf (&buf, "%s: %s",
-                        result->errstring, strerror (result->errcode)) != -1)
+         && __asprintf (&buf, "%s: %s: %s",
+                        result->objname, _(result->errstring),
+                        strerror (result->errcode)) != -1)
        {
          /* We don't need the error string anymore.  */
-         free (result->errstring);
+         free ((char *) result->errstring);
          result->errstring = buf;
        }
 
@@ -119,9 +122,10 @@ _dlerror_run (void (*operate) (void *), void *args)
   if (result->errstring != NULL)
     /* Free the error string from the last failed command.  This can
        happen if `dlerror' was not run after an error was found.  */
-    free (result->errstring);
+    free ((char *) result->errstring);
 
-  result->errcode = _dl_catch_error (&result->errstring, operate, args);
+  result->errcode = _dl_catch_error (&result->objname, &result->errstring,
+                                    operate, args);
 
   /* If no error we mark that no error string is available.  */
   result->returned = result->errstring == NULL;
This page took 0.049257 seconds and 5 git commands to generate.