summaryrefslogtreecommitdiff
path: root/libgcompat/readlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgcompat/readlink.c')
-rw-r--r--libgcompat/readlink.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libgcompat/readlink.c b/libgcompat/readlink.c
index 63def96..9b3e2dd 100644
--- a/libgcompat/readlink.c
+++ b/libgcompat/readlink.c
@@ -1,4 +1,5 @@
#include <dlfcn.h>
+#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <stddef.h>
@@ -18,6 +19,7 @@ ssize_t readlink(const char *path, char *buf, size_t len)
if (real_readlink == NULL) {
real_readlink = dlsym(RTLD_NEXT, "readlink");
if (real_readlink == NULL) {
+ errno = ENOSYS;
return -1;
}
}
@@ -78,6 +80,7 @@ ssize_t readlink(const char *path, char *buf, size_t len)
close(fd);
fail:
exe[0] = '\0';
+ errno = EIO;
return -1;
}