changeset 1378:5b37c6d8cd35

Fix braino: check S_ISLNK only if lstat succeeds.
author Jim Meyering <jim@meyering.net>
date Sun, 24 May 1998 14:00:03 +0000
parents 0f6f593b4f5a
children 1fb78508ba25
files lib/lchown.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lib/lchown.c
+++ b/lib/lchown.c
@@ -34,7 +34,7 @@
 {
   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;