diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1997-02-09 23:58:45 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1997-02-09 23:58:45 +0000 |
commit | b422126a9f85ea5db78f94af33944c1fc2d7688b (patch) | |
tree | 6f36ae5252edf74c47c797bbf26b2d1394c3a7f8 /usr.bin/file/fsmagic.c | |
parent | f45ed397f9eaba4002d360a56368c365a1aeabd2 (diff) |
Updates file(1) to version 3.22 by way to NetBSD.
Diffstat (limited to 'usr.bin/file/fsmagic.c')
-rw-r--r-- | usr.bin/file/fsmagic.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/usr.bin/file/fsmagic.c b/usr.bin/file/fsmagic.c index 33cd2dbfcb5..f5ba6ee0b4e 100644 --- a/usr.bin/file/fsmagic.c +++ b/usr.bin/file/fsmagic.c @@ -1,4 +1,5 @@ -/* $OpenBSD: fsmagic.c,v 1.2 1996/06/26 05:32:57 deraadt Exp $ */ +/* $OpenBSD: fsmagic.c,v 1.3 1997/02/09 23:58:24 millert Exp $ */ + /* * fsmagic - magic based on filesystem info - directory, special files, etc. * @@ -32,6 +33,11 @@ #include <sys/stat.h> #include <unistd.h> #include <stdlib.h> +#ifndef major +# if defined(__SVR4) || defined(_SVR4_SOURCE) +# include <sys/mkdev.h> +# endif +#endif #ifndef major /* if `major' not defined in types.h, */ #include <sys/sysmacros.h> /* try this one. */ #endif @@ -46,7 +52,7 @@ #include "file.h" #ifndef lint -static char *moduleid = "$OpenBSD: fsmagic.c,v 1.2 1996/06/26 05:32:57 deraadt Exp $"; +static char *moduleid = "$OpenBSD: fsmagic.c,v 1.3 1997/02/09 23:58:24 millert Exp $"; #endif /* lint */ int @@ -84,12 +90,12 @@ struct stat *sb; ckfputs("directory", stdout); return 1; case S_IFCHR: - (void) printf("character special (%d/%d)", - major(sb->st_rdev), minor(sb->st_rdev)); + (void) printf("character special (%ld/%ld)", + (long) major(sb->st_rdev), (long) minor(sb->st_rdev)); return 1; case S_IFBLK: - (void) printf("block special (%d/%d)", - major(sb->st_rdev), minor(sb->st_rdev)); + (void) printf("block special (%ld/%ld)", + (long) major(sb->st_rdev), (long) minor(sb->st_rdev)); return 1; /* TODO add code to handle V7 MUX and Blit MUX files */ #ifdef S_IFIFO |