summaryrefslogtreecommitdiff
path: root/sys/kern/kern_conf.c
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>1999-09-13 12:29:32 +0000
committerBruce Evans <bde@FreeBSD.org>1999-09-13 12:29:32 +0000
commitc32cc1493f96e4095f5f3fb0a2d436a8a81277ab (patch)
treebbdc749417050ca6823115286327897bc786beb4 /sys/kern/kern_conf.c
parent8dc47ef6069cce08822735df00699072f4db236d (diff)
downloadsrc-test2-c32cc1493f96e4095f5f3fb0a2d436a8a81277ab.tar.gz
src-test2-c32cc1493f96e4095f5f3fb0a2d436a8a81277ab.zip
Notes
Diffstat (limited to 'sys/kern/kern_conf.c')
-rw-r--r--sys/kern/kern_conf.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c
index 325c7ef51def..43c026ce0b07 100644
--- a/sys/kern/kern_conf.c
+++ b/sys/kern/kern_conf.c
@@ -357,10 +357,11 @@ remove_dev(dev_t dev)
freedev(dev);
}
-char *
+const char *
devtoname(dev_t dev)
{
char *p;
+ int mynor;
if (dev->si_name[0] == '#' || dev->si_name[0] == '\0') {
p = dev->si_name;
@@ -369,8 +370,11 @@ devtoname(dev_t dev)
else
sprintf(p, "#%d/", major(dev));
p += strlen(p);
- sprintf(p, minor(dev) > 255 ? "0x%x" : "%d", minor(dev));
+ mynor = minor(dev);
+ if (mynor < 0 || mynor > 255)
+ sprintf(p, "%#x", (u_int)mynor);
+ else
+ sprintf(p, "%d", mynor);
}
return (dev->si_name);
}
-