put #if's around the lchown, because
authorJohn Beppu <beppu@lbox.org>
Mon, 24 Jan 2000 12:06:22 +0000 (12:06 -0000)
committerJohn Beppu <beppu@lbox.org>
Mon, 24 Jan 2000 12:06:22 +0000 (12:06 -0000)
older glibc versions don't have it.

chmod_chown_chgrp.c

index 75db904..fb5cb92 100644 (file)
@@ -55,8 +55,14 @@ static int fileAction(const char *fileName, struct stat* statbuf)
     switch (whichApp) {
        case CHGRP_APP:
        case CHOWN_APP:
+#if (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 1)
            if (lchown(fileName, (whichApp==CHOWN_APP)? uid : statbuf->st_uid, 
-                       (gid==-1)? statbuf->st_gid : gid) == 0) {
+                       (gid==-1)? statbuf->st_gid : gid) == 0) 
+#else
+           if (chown(fileName, (whichApp==CHOWN_APP)? uid : statbuf->st_uid, 
+                       (gid==-1)? statbuf->st_gid : gid) == 0) 
+#endif
+           {
                return( TRUE);
            }
            break;