Date: Sat, 28 Jan 2023 13:38:05 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 269190] bugs in stat(1) and devname(3), wrong report on disk names Message-ID: <bug-269190-227-O8m8MllKx6@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-269190-227@https.bugs.freebsd.org/bugzilla/>
index | next in thread | previous in thread | raw e-mail
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=269190 Konstantin Belousov <kib@FreeBSD.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kib@FreeBSD.org --- Comment #1 from Konstantin Belousov <kib@FreeBSD.org> --- WRT the stat(1) patch, why do you _not_ pass S_IFBLK when the device is the block device? IMO it is more correct to do the following: #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 */ -- You are receiving this mail because: You are the assignee for the bug.help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-269190-227-O8m8MllKx6>
