]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(unary_operator): (-u, -g): Return false if S_ISUID,S_ISGID etc aren't defined.
authorJim Meyering <jim@meyering.net>
Sat, 23 Jul 1994 03:58:31 +0000 (03:58 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 23 Jul 1994 03:58:31 +0000 (03:58 +0000)
src/test.c

index 9421fea104a8a8b12b956d9cf0bf36b1b06fc273..4fc35bbaff479af7491ea3c8ec9d75e455085fe4 100644 (file)
@@ -824,23 +824,31 @@ unary_operator ()
 
     case 'u':                  /* File is setuid? */
       unary_advance ();
+#ifndef S_ISUID
+      return (FALSE);
+#else
       if (test_stat (argv[pos - 1], &stat_buf) < 0)
        return (FALSE);
 
       return (TRUE == (0 != (stat_buf.st_mode & S_ISUID)));
+#endif
 
     case 'g':                  /* File is setgid? */
       unary_advance ();
+#ifndef S_ISGID
+      return (FALSE);
+#else
       if (test_stat (argv[pos - 1], &stat_buf) < 0)
        return (FALSE);
 
       return (TRUE == (0 != (stat_buf.st_mode & S_ISGID)));
+#endif
 
     case 'k':                  /* File has sticky bit set? */
       unary_advance ();
       if (test_stat (argv[pos - 1], &stat_buf) < 0)
        return (FALSE);
-#if !defined (S_ISVTX)
+#ifndef S_ISVTX
       /* This is not Posix, and is not defined on some Posix systems. */
       return (FALSE);
 #else