]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(print_stat): Use S_ISLNK rather than an explicit
authorJim Meyering <jim@meyering.net>
Fri, 31 Jan 2003 13:52:18 +0000 (13:52 +0000)
committerJim Meyering <jim@meyering.net>
Fri, 31 Jan 2003 13:52:18 +0000 (13:52 +0000)
test using S_IFMT and S_IFLNK.  S_IFLNK may not be defined.

src/stat.c

index 61afafb2a94ca68b9edfa533086217258390fe56..7f2c5d2a4dcbd049bbd8b51dd61d9756e7d21a3b 100644 (file)
@@ -448,7 +448,7 @@ print_stat (char *pformat, char m, char const *filename, void const *data)
       break;
     case 'N':
       strcat (pformat, "s");
-      if ((statbuf->st_mode & S_IFMT) == S_IFLNK)
+      if (S_ISLNK (statbuf->st_mode))
        {
          char *linkname = xreadlink (filename);
          if (linkname == NULL)