diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-07-01 19:14:28 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-07-01 19:14:28 +0000 |
commit | 3ed176b8f3a673cc387cce988c203235987c8af5 (patch) | |
tree | bb27e78bad76b5313e159eb781347bf7d97e5430 /gnu/usr.bin | |
parent | c39a12f0600c79415abe78aec4ac5ee48d370638 (diff) |
have DL_GETERRNO clear error state after return; also make dlsym() set error state
Diffstat (limited to 'gnu/usr.bin')
-rw-r--r-- | gnu/usr.bin/ld/rtld/rtld.c | 5 |
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; |