about summary refs log tree commit diff
path: root/sysdeps/posix/fpathconf.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/posix/fpathconf.c')
-rw-r--r--sysdeps/posix/fpathconf.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sysdeps/posix/fpathconf.c b/sysdeps/posix/fpathconf.c
index 1e7cba47ed..572c0de0b1 100644
--- a/sysdeps/posix/fpathconf.c
+++ b/sysdeps/posix/fpathconf.c
@@ -67,19 +67,11 @@ __fpathconf (fd, name)
 
     case _PC_NAME_MAX:
 #ifdef	NAME_MAX
-      return NAME_MAX;
-#else
-      __set_errno (ENOSYS);
-      return -1;
-#endif
-
-    case _PC_PATH_MAX:
-#ifdef	PATH_MAX
       {
 	struct statfs buf;
 
 	if (__fstatfs (fd, &buf) < 0)
-	  return errno == ENOSYS ? PATH_MAX : -1;
+	  return errno == ENOSYS ? NAME_MAX : -1;
 	else
 	  return buf.f_namelen;
       }
@@ -88,6 +80,14 @@ __fpathconf (fd, name)
       return -1;
 #endif
 
+    case _PC_PATH_MAX:
+#ifdef	PATH_MAX
+      return PATH_MAX;
+#else
+      __set_errno (ENOSYS);
+      return -1;
+#endif
+
     case _PC_PIPE_BUF:
 #ifdef	PIPE_BUF
       return PIPE_BUF;