Recognize the magic NODEV value.

Format other unknown devices consistently in hex.
This commit is contained in:
Poul-Henning Kamp 2003-06-05 21:55:57 +00:00
parent 7ad3fab81e
commit c6dd496cd9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=115881

View File

@ -105,10 +105,10 @@ devname(dev, type)
}
/* Finally just format it */
if (minor(dev) > 255)
if (dev == NODEV)
r = "#NODEV";
else
r = "#%c:%d:0x%x";
else
r = "#%c:%d:0x%d";
snprintf(buf, SPECNAMELEN + 1, r,
(type & S_IFMT) == S_IFCHR ? 'C' : 'B', major(dev), minor(dev));
return (buf);