Only output major/minor info for a character/block device, not for

a FIFO or a socket.
This commit is contained in:
Wayne Davison committed 2004-09-23 05:33:48 +00:00
1 parent a33857da09
commit 48d3ff94c9
1 file changed
+1 -1
+1 -1
View File
@@ -113,7 +113,7 @@ static void list_file(const char *fname)
/* TODO: Perhaps escape special characters in fname? */
printf("%s ", permbuf);
if (IS_DEVICE(buf.st_mode)) {
if (S_ISCHR(buf.st_mode) || S_ISBLK(buf.st_mode)) {
printf("%5ld,%6ld",
(long)major(buf.st_rdev),
(long)minor(buf.st_rdev));