stat(1): Do not pass S_IFBLK to devname unconditionally
PR: 269190 Reviewed by: kib MFC after: 1 week
This commit is contained in:
parent
0311fe403d
commit
050e4bca94
@ -640,14 +640,9 @@ format1(const struct stat *st,
|
||||
small = (sizeof(st->st_dev) == 4);
|
||||
data = (what == SHOW_st_dev) ? st->st_dev : st->st_rdev;
|
||||
#if HAVE_DEVNAME
|
||||
sdata = (what == SHOW_st_dev) ?
|
||||
devname(st->st_dev, S_IFBLK) :
|
||||
devname(st->st_rdev,
|
||||
S_ISCHR(st->st_mode) ? S_IFCHR :
|
||||
S_ISBLK(st->st_mode) ? S_IFBLK :
|
||||
0U);
|
||||
if (sdata == NULL)
|
||||
sdata = "???";
|
||||
sdata = devname(what == SHOW_st_dev ? st->st_dev :
|
||||
st->st_rdev, S_ISCHR(st->st_mode) ? S_IFCHR :
|
||||
(S_ISBLK(st->st_mode) ? S_IFBLK : 0));
|
||||
#endif /* HAVE_DEVNAME */
|
||||
if (hilo == HIGH_PIECE) {
|
||||
data = major(data);
|
||||
|
Loading…
Reference in New Issue
Block a user