about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/getcwd.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/getcwd.c')
-rw-r--r--sysdeps/unix/sysv/linux/getcwd.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sysdeps/unix/sysv/linux/getcwd.c b/sysdeps/unix/sysv/linux/getcwd.c
index 0bf9a9fb0e..fb483ac076 100644
--- a/sysdeps/unix/sysv/linux/getcwd.c
+++ b/sysdeps/unix/sysv/linux/getcwd.c
@@ -37,7 +37,7 @@ static char *generic_getcwd (char *buf, size_t size) internal_function;
    directory: a syscall.  We've got to be careful that even when
    compiling under 2.1.92+ the libc still runs under older kernels. */
 extern int __syscall_getcwd (char *buf, unsigned long size);
-static no_syscall_getcwd;
+static int no_syscall_getcwd;
 static int no_new_dcache = 1;
 #else
 static int no_new_dcache;
@@ -52,7 +52,7 @@ __getcwd (char *buf, size_t size)
   char *result;
   size_t alloc_size = size;
 
-  if (no_new_dcache)
+  if (no_syscall_getcwd && no_new_dcache)
     return generic_getcwd (buf, size);
 
   if (size == 0)
@@ -82,7 +82,6 @@ __getcwd (char *buf, size_t size)
     {
       int retval;
 
-      do
       retval = __syscall_getcwd (path, alloc_size);
       if (retval >= 0)
 	{