summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1997-07-01 19:14:27 +0000
committerderaadt <deraadt@openbsd.org>1997-07-01 19:14:27 +0000
commit138c7e16b71e68665ec5189a99827e01cb0f1e20 (patch)
tree8a3874b0dc40555ccd7e38d7b0b7b258866f92f5
parentsplit -a into -a/-A (diff)
downloadwireguard-openbsd-138c7e16b71e68665ec5189a99827e01cb0f1e20.tar.xz
wireguard-openbsd-138c7e16b71e68665ec5189a99827e01cb0f1e20.zip
have DL_GETERRNO clear error state after return; also make dlsym() set error state
-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;