summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/devname.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/gen/devname.c')
-rw-r--r--lib/libc/gen/devname.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libc/gen/devname.c b/lib/libc/gen/devname.c
index 65a690f..da0b923 100644
--- a/lib/libc/gen/devname.c
+++ b/lib/libc/gen/devname.c
@@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$");
#include <sys/sysctl.h>
#include <stdio.h>
+#include <stdint.h>
#include <string.h>
#include <sys/param.h>
#include <sys/stat.h>
@@ -60,8 +61,8 @@ devname_r(dev_t dev, mode_t type, char *buf, int len)
}
/* Finally just format it */
- snprintf(buf, len, "#%c:%d:0x%x",
- S_ISCHR(type) ? 'C' : 'B', major(dev), minor(dev));
+ snprintf(buf, len, "#%c:%#jx",
+ S_ISCHR(type) ? 'C' : 'B', (uintmax_t)dev);
return (buf);
}
OpenPOWER on IntegriCloud