From c498a34843599201bd4521504d1c6527abb523f3 Mon Sep 17 00:00:00 2001 From: David van Moolenbroek Date: Thu, 7 Nov 2013 16:51:21 +0000 Subject: [PATCH] toproto: use NetBSD names/types for device numbers This should unbreak crossbuilding from Ubuntu 32-bit Change-Id: I6ead9f8289dba6271c52dace81abffaabe6c8869 --- usr.bin/toproto/Makefile | 4 +++- usr.bin/toproto/toproto.c | 10 ++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/usr.bin/toproto/Makefile b/usr.bin/toproto/Makefile index 15261aaec..defad47d4 100644 --- a/usr.bin/toproto/Makefile +++ b/usr.bin/toproto/Makefile @@ -4,5 +4,7 @@ PROG=toproto MAN= -.include +CPPFLAGS+= -I${NETBSDSRCDIR}/sbin/mknod +.PATH: ${NETBSDSRCDIR}/sbin/mknod +.include diff --git a/usr.bin/toproto/toproto.c b/usr.bin/toproto/toproto.c index a5069805c..affcc079a 100644 --- a/usr.bin/toproto/toproto.c +++ b/usr.bin/toproto/toproto.c @@ -11,6 +11,8 @@ #include #include +#include "pack_dev.h" + #define MAX_ENTRIES 100000 #define MAX_LINE_SIZE 0xfff @@ -38,8 +40,8 @@ struct entry char *size; char *link; /* Can't use devmajor_t/devminor_t on linux systems :( */ - dev_t dev_major; - dev_t dev_minor; + int32_t dev_major; + int32_t dev_minor; /* just internal variables used to create a tree */ int depth; @@ -123,8 +125,8 @@ convert_to_entry(char *line, struct entry *entry) } else if (strncmp(key, "device", 7) == 0) { long int dev_id; dev_id = strtoul(value, NULL, 16); - entry->dev_major = major(dev_id); - entry->dev_minor = minor(dev_id); + entry->dev_major = major_netbsd(dev_id); + entry->dev_minor = minor_netbsd(dev_id); } else { fprintf(stderr, "\tunknown attribute %s -> %s\n", key,