diff options
Diffstat (limited to 'usr.bin/xinstall')
-rw-r--r-- | usr.bin/xinstall/xinstall.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/usr.bin/xinstall/xinstall.c b/usr.bin/xinstall/xinstall.c index 2a6c062..2e1f8b8 100644 --- a/usr.bin/xinstall/xinstall.c +++ b/usr.bin/xinstall/xinstall.c @@ -42,7 +42,7 @@ static const char copyright[] = static char sccsid[] = "From: @(#)xinstall.c 8.1 (Berkeley) 7/21/93"; #endif static const char rcsid[] = - "$Id: xinstall.c,v 1.29 1998/01/11 11:43:36 peter Exp $"; + "$Id: xinstall.c,v 1.30 1998/01/13 02:12:43 alex Exp $"; #endif /* not lint */ /*- @@ -87,7 +87,7 @@ static const char rcsid[] = #define MAP_FAILED ((void *)-1) /* from <sys/mman.h> */ #endif -int debug, docompare, docopy, dodir, dopreserve, dostrip, verbose, nommap; +int debug, docompare, docopy, dodir, dopreserve, dostrip, nommap, verbose; int mode = S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH; char *group, *owner, pathbuf[MAXPATHLEN]; char pathbuf2[MAXPATHLEN]; @@ -712,22 +712,18 @@ int trymmap(fd) int fd; { +/* + * The ifdef is for bootstrapping - f_fstypename doesn't exist in + * pre-Lite2-merge systems. + */ +#ifdef MFSNAMELEN struct statfs stfs; - if (nommap || fstatfs(fd, &stfs) < 0) - return 0; - -/* NetBSD MOUNT_XXX defines are strings, but doesn't have a MOUNT_NONE. */ -#ifdef MOUNT_NONE - switch(stfs.f_type) { - case MOUNT_UFS: /* should be safe.. */ - case MOUNT_CD9660: /* should be safe.. */ - return 1; - } -#else - if (strcmp(stfs.f_fstypename,MOUNT_UFS) == 0 || - strcmp(stfs.f_fstypename,MOUNT_CD9660) == 0) - return 1; + if (nommap || fstatfs(fd, &stfs) != 0) + return (0); + if (strcmp(stfs.f_fstypename, "ufs") == 0 || + strcmp(stfs.f_fstypename, "cd9660") == 0) + return (1); #endif - return 0; + return (0); } |