From: Jim Meyering Date: Sun, 24 May 1998 14:00:03 +0000 (+0000) Subject: Fix braino: check S_ISLNK only if lstat succeeds. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6cf802f3b281eee2135088d0dd55459597fe2b18;p=pspp Fix braino: check S_ISLNK only if lstat succeeds. --- diff --git a/lib/lchown.c b/lib/lchown.c index 3e2b6c9f25..0b1ebd8f2c 100644 --- a/lib/lchown.c +++ b/lib/lchown.c @@ -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;