diff options
author | Ulrich Drepper <drepper@redhat.com> | 1998-03-12 14:28:15 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1998-03-12 14:28:15 +0000 |
commit | 8fd5887698f380068fdf583d452b1f2210f5eb9a (patch) | |
tree | c7d451b9c30de0ee0473337ee11d5ec820f4f731 /elf | |
parent | d834d54a518416ebb6902025653a1a503690294a (diff) | |
download | glibc-8fd5887698f380068fdf583d452b1f2210f5eb9a.tar.gz glibc-8fd5887698f380068fdf583d452b1f2210f5eb9a.tar.xz glibc-8fd5887698f380068fdf583d452b1f2210f5eb9a.zip |
(struct catch): Remove objname member.
(_dl_signal_error): Construct string including objname when given. (_dl_catch_error): Remove objname handling.
Diffstat (limited to 'elf')
-rw-r--r-- | elf/dl-error.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/elf/dl-error.c b/elf/dl-error.c index a19ccff626..9f538e9318 100644 --- a/elf/dl-error.c +++ b/elf/dl-error.c @@ -1,5 +1,5 @@ /* Error handling for runtime dynamic linker. - Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1998 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 @@ -28,7 +28,6 @@ struct catch { char *errstring; /* Error detail filled in here. */ - const char *objname; jmp_buf env; /* longjmp here on error. */ }; @@ -56,11 +55,18 @@ _dl_signal_error (int errcode, /* We are inside _dl_catch_error. Return to it. We have to duplicate the error string since it might be allocated on the stack. */ - size_t len = strlen (errstring) + 1; - catch->errstring = malloc (len); + size_t objname_len = objname ? strlen (objname) + 2 : 0; + size_t errstring_len = strlen (errstring) + 1; + catch->errstring = malloc (objname_len + errstring_len); if (catch->errstring != NULL) - memcpy (catch->errstring, errstring, len); - catch->objname = objname; + { + if (objname_len > 0) + { + memcpy (catch->errstring, objname, objname_len - 2); + memcpy (catch->errstring + objname_len - 2, ": ", 2); + } + memcpy (catch->errstring + objname_len, errstring, errstring_len); + } longjmp (catch->env, errcode ?: -1); } else if (receiver) @@ -84,11 +90,10 @@ _dl_signal_error (int errcode, int _dl_catch_error (char **errstring, - const char **objname, void (*operate) (void)) { int errcode; - struct catch *old, c = { errstring: NULL, objname: NULL }; + struct catch *old, c = { errstring: NULL }; /* We need not handle `receiver' since setting a `catch' is handle before it. */ @@ -100,14 +105,12 @@ _dl_catch_error (char **errstring, (*operate) (); catch = old; *errstring = NULL; - *objname = NULL; return 0; } /* We get here only if we longjmp'd out of OPERATE. */ catch = old; *errstring = c.errstring; - *objname = c.objname; return errcode == -1 ? 0 : errcode; } |