(test_stat, binary_operator): Use safe_stat instead of SAFE_STAT.

(unary_operator): Use safe_lstat instead of SAFE_LSTAT.
This commit is contained in:
Jim Meyering 1994-12-20 04:51:10 +00:00
parent 6d59e126b5
commit 735c6a9adc

View File

@ -153,7 +153,7 @@ test_stat (path, finfo)
errno = ENOENT;
return (-1);
}
return (SAFE_STAT (path, finfo));
return (safe_stat (path, finfo));
}
/* Do the same thing access(2) does, but use the effective uid and gid,
@ -591,9 +591,9 @@ binary_operator ()
pos += 3;
if (l_is_l || r_is_l)
test_syntax_error ("-ef does not accept -l\n", (char *)NULL);
if (SAFE_STAT (argv[op - 1], &stat_buf) < 0)
if (safe_stat (argv[op - 1], &stat_buf) < 0)
return (FALSE);
if (SAFE_STAT (argv[op + 1], &stat_spare) < 0)
if (safe_stat (argv[op + 1], &stat_spare) < 0)
return (FALSE);
return (TRUE ==
(stat_buf.st_dev == stat_spare.st_dev &&
@ -756,7 +756,7 @@ unary_operator ()
#else
/* An empty filename is not a valid pathname. */
if ((argv[pos - 1][0] == '\0') ||
(SAFE_LSTAT (argv[pos - 1], &stat_buf) < 0))
(safe_lstat (argv[pos - 1], &stat_buf) < 0))
return (FALSE);
return (TRUE == (S_ISLNK (stat_buf.st_mode)));