]> Zhao Yanbai Git Server - minix.git/commitdiff
toproto: use NetBSD names/types for device numbers
authorDavid van Moolenbroek <david@minix3.org>
Thu, 7 Nov 2013 16:51:21 +0000 (16:51 +0000)
committerLionel Sambuc <lionel@minix3.org>
Sat, 1 Mar 2014 08:05:01 +0000 (09:05 +0100)
This should unbreak crossbuilding from Ubuntu 32-bit

Change-Id: I6ead9f8289dba6271c52dace81abffaabe6c8869

usr.bin/toproto/Makefile
usr.bin/toproto/toproto.c

index 15261aaec2311788b1c09bf6e7107b92f0790cdd..defad47d4af4cde30b6a4d810ae1cc000035e0ff 100644 (file)
@@ -4,5 +4,7 @@
 PROG=toproto
 MAN=
 
-.include <bsd.prog.mk>
+CPPFLAGS+=      -I${NETBSDSRCDIR}/sbin/mknod
+.PATH:          ${NETBSDSRCDIR}/sbin/mknod
 
+.include <bsd.prog.mk>
index a5069805c045ca281e0b84bea8010f654cb2f13d..affcc079a802090fd4ca758dd03558e12327c7ff 100644 (file)
@@ -11,6 +11,8 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 
+#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,