From dd284552b419de74006da5a064a56dacba5685da Mon Sep 17 00:00:00 2001 From: Ben Gras Date: Fri, 27 Jan 2006 13:57:18 +0000 Subject: [PATCH] fixes to include major() and minor() in system header files (in a different file than sys/types.h) small binpackage update --- commands/scripts/binpackage.sh | 11 +++++++++++ commands/simple/mkproto.c | 2 ++ include/minix/const.h | 4 ---- include/sys/types.h | 14 ++++++++++++-- 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/commands/scripts/binpackage.sh b/commands/scripts/binpackage.sh index 28c29c7e6..71eee8d55 100644 --- a/commands/scripts/binpackage.sh +++ b/commands/scripts/binpackage.sh @@ -4,6 +4,11 @@ set -e dir=$1 +if [ $# -lt 1 ] +then echo "Usage: $0 packagedir" + exit 1 +fi + if [ ! -d "$dir" ] then echo "Error: $dir isn't a directory." exit 1 @@ -21,6 +26,12 @@ binsizes big touch $packagestart sleep 1 cd $dir + +if [ ! -f build ] +then echo "Error: No build script in $dir." + exit 1 +fi + sh build cd / echo " * Making file index, writing $targz" diff --git a/commands/simple/mkproto.c b/commands/simple/mkproto.c index 09ce30030..b40d26ba9 100755 --- a/commands/simple/mkproto.c +++ b/commands/simple/mkproto.c @@ -19,8 +19,10 @@ #define DEF_INODES 63 #define DEF_INDENTSTR "\t" +#ifndef major #define major(x) ( (x>>8) & 0377) #define minor(x) (x & 0377) +#endif /* Globals. */ int count, origlen, tabs; diff --git a/include/minix/const.h b/include/minix/const.h index 6c9e1792a..c0639180a 100755 --- a/include/minix/const.h +++ b/include/minix/const.h @@ -18,10 +18,6 @@ #define SUPER_USER (uid_t) 0 /* uid_t of superuser */ -/* Devices. */ -#define MAJOR 8 /* major device = (dev>>MAJOR) & 0377 */ -#define MINOR 0 /* minor device = (dev>>MINOR) & 0377 */ - #define NULL ((void *)0) /* null pointer */ #define CPVEC_NR 16 /* max # of entries in a SYS_VCOPY request */ #define CPVVEC_NR 64 /* max # of entries in a SYS_VCOPY request */ diff --git a/include/sys/types.h b/include/sys/types.h index e8415a903..6c222f25c 100755 --- a/include/sys/types.h +++ b/include/sys/types.h @@ -126,9 +126,19 @@ typedef unsigned int u_int; typedef unsigned long u_long; typedef char *caddr_t; +/* Devices. */ +#define MAJOR 8 /* major device = (dev>>MAJOR) & 0377 */ +#define MINOR 0 /* minor device = (dev>>MINOR) & 0377 */ + +#ifndef minor +#define minor(dev) (((dev) >> MINOR) & 0xff) +#endif + +#ifndef major +#define major(dev) (((dev) >> MAJOR) & 0xff) +#endif + #ifndef makedev -#define minor(dev) (((dev) >> MINOR) & BYTE) -#define major(dev) (((dev) >> MAJOR) & BYTE) #define makedev(major, minor) \ ((dev_t) (((major) << MAJOR) | ((minor) << MINOR))) #endif -- 2.44.0