summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-07-01 19:14:28 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-07-01 19:14:28 +0000
commit3ed176b8f3a673cc387cce988c203235987c8af5 (patch)
treebb27e78bad76b5313e159eb781347bf7d97e5430 /gnu
parentc39a12f0600c79415abe78aec4ac5ee48d370638 (diff)
have DL_GETERRNO clear error state after return; also make dlsym() set error state
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/ld/rtld/rtld.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gnu/usr.bin/ld/rtld/rtld.c b/gnu/usr.bin/ld/rtld/rtld.c
index 48517ab5ceb..e7a6395cbba 100644
--- a/gnu/usr.bin/ld/rtld/rtld.c
+++ b/gnu/usr.bin/ld/rtld/rtld.c
@@ -1496,8 +1496,10 @@ __dlsym(fd, sym)
src_map = smp;
np = lookup(sym, &src_map, 1);
- if (np == NULL)
+ if (np == NULL) {
+ dlerrno = ENOENT;
return NULL;
+ }
/* Fixup jmpslot so future calls transfer directly to target */
addr = np->nz_value;
@@ -1515,6 +1517,7 @@ __dlctl(fd, cmd, arg)
switch (cmd) {
case DL_GETERRNO:
*(int *)arg = dlerrno;
+ dlerrno = 0;
return 0;
default:
dlerrno = EOPNOTSUPP;