about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/dl-origin.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/dl-origin.c')
-rw-r--r--sysdeps/unix/sysv/linux/dl-origin.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sysdeps/unix/sysv/linux/dl-origin.c b/sysdeps/unix/sysv/linux/dl-origin.c
index f7512340a1..a7fa53ea1d 100644
--- a/sysdeps/unix/sysv/linux/dl-origin.c
+++ b/sysdeps/unix/sysv/linux/dl-origin.c
@@ -24,6 +24,7 @@
 #include <unistd.h>
 #include <sys/param.h>
 #include <ldsodefs.h>
+#include <sysdep.h>
 
 #include <dl-dst.h>
 
@@ -37,9 +38,11 @@ _dl_get_origin (void)
   char linkval[PATH_MAX];
   char *result;
   int len;
+  INTERNAL_SYSCALL_DECL (err);
 
-  if ((len = __readlink ("/proc/self/exe", linkval, sizeof (linkval))) > 0
-      && linkval[0] != '[')
+  len = INTERNAL_SYSCALL (readlink, err, 3, "/proc/self/exe", linkval,
+			  sizeof (linkval));
+  if (! INTERNAL_SYSCALL_ERROR_P (len, err) && len > 0 && linkval[0] != '[')
     {
       /* We can use this value.  */
       assert (linkval[0] == '/');