Fix braino: check S_ISLNK only if lstat succeeds.
authorJim Meyering <jim@meyering.net>
Sun, 24 May 1998 14:00:03 +0000 (14:00 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 24 May 1998 14:00:03 +0000 (14:00 +0000)
lib/lchown.c

index 3e2b6c9f25a3f0eb77df6164af3a7900fbb16b80..0b1ebd8f2c7614411694d1de0b608d6f8b9953d1 100644 (file)
@@ -34,7 +34,7 @@ lchown (const char *file, uid_t uid, gid_t gid)
 {
   struct stat stats;
 
-  if (lstat (file, &stats) && S_ISLNK (stats.st_mode))
+  if (lstat (file, &stats) == 0 && S_ISLNK (stats.st_mode))
     {
       errno = ENOSYS;
       return -1;