about summary refs log tree commit diff
path: root/io
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2008-03-14 17:22:27 +0000
committerJakub Jelinek <jakub@redhat.com>2008-03-14 17:22:27 +0000
commitb87b7fc3e6e41cf8006fb2341c236a46f6d8bdd4 (patch)
tree8b042dd05d766dd46dfa953aec240207eae14208 /io
parent5c25449dd9fd706f79ee6d92019f28044d9270fa (diff)
downloadglibc-b87b7fc3e6e41cf8006fb2341c236a46f6d8bdd4.tar.gz
glibc-b87b7fc3e6e41cf8006fb2341c236a46f6d8bdd4.tar.xz
glibc-b87b7fc3e6e41cf8006fb2341c236a46f6d8bdd4.zip
Updated to fedora-glibc-20080310T1651
Diffstat (limited to 'io')
-rw-r--r--io/tst-fchownat.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/io/tst-fchownat.c b/io/tst-fchownat.c
index fd32ac9e6b..da8fd3b023 100644
--- a/io/tst-fchownat.c
+++ b/io/tst-fchownat.c
@@ -19,14 +19,17 @@ static int dir_fd;
 static void
 prepare (void)
 {
-#if _POSIX_CHOWN_RESTRICTED > 0
-  uid_t uid = getuid ();
-  if (uid != 0)
+#if _POSIX_CHOWN_RESTRICTED == 0
+  if (pathconf (test_dir, _PC_CHOWN_RESTRICTED) != 0)
+#endif
     {
-      puts ("need root privileges");
-      exit (0);
+      uid_t uid = getuid ();
+      if (uid != 0)
+	{
+	  puts ("need root privileges");
+	  exit (0);
+	}
     }
-#endif
 
   size_t test_dir_len = strlen (test_dir);
   static const char dir_name[] = "/tst-fchownat.XXXXXX";