Don't try to even fake building a filesystem on a file descriptor that is
neither a file nor a character special device.
This commit is contained in:
parent
891d055e7c
commit
f4bbda4f6c
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: newfs.c,v 1.20 2006/05/04 04:39:15 perseant Exp $ */
|
||||
/* $NetBSD: newfs.c,v 1.21 2006/08/06 00:14:17 perseant Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1989, 1992, 1993
|
||||
|
@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1992, 1993\n\
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)newfs.c 8.5 (Berkeley) 5/24/95";
|
||||
#else
|
||||
__RCSID("$NetBSD: newfs.c,v 1.20 2006/05/04 04:39:15 perseant Exp $");
|
||||
__RCSID("$NetBSD: newfs.c,v 1.21 2006/08/06 00:14:17 perseant Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -290,6 +290,10 @@ main(int argc, char **argv)
|
|||
|
||||
|
||||
if (!S_ISCHR(st.st_mode)) {
|
||||
if (!S_ISREG(st.st_mode)) {
|
||||
fatal("%s: neither a character special device "
|
||||
"nor a regular file", special);
|
||||
}
|
||||
if (debug) {
|
||||
lp = debug_readlabel(fsi);
|
||||
pp = &lp->d_partitions[0];
|
||||
|
|
Loading…
Reference in New Issue