Skip to content

Commit

Permalink
Only output major/minor info for a character/block device, not for
Browse files Browse the repository at this point in the history
a FIFO or a socket.
  • Loading branch information
Wayne Davison committed Sep 23, 2004
1 parent a33857d commit 48d3ff9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 48d3ff9

Please sign in to comment.