diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1997-08-20 05:10:29 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1997-08-20 05:10:29 +0000 |
commit | 4dbea4d156fdd79e17137250bcd9a12c9ad09c3b (patch) | |
tree | 4d8cbcbf5eac0e6e596e4b51ab324244fcdc874b /sbin/mount_fdesc/mount_fdesc.c | |
parent | 02165d4ef16cba14b8092704510f78d0c8b62059 (diff) |
Print "Filesystem not supported by kernel" not "Operation not supported by
device" (EOPNOTSUPP) so the real problem is obvious. Idea from Peter Seebach
<seebs@taniemarie.solon.com>.
Diffstat (limited to 'sbin/mount_fdesc/mount_fdesc.c')
-rw-r--r-- | sbin/mount_fdesc/mount_fdesc.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sbin/mount_fdesc/mount_fdesc.c b/sbin/mount_fdesc/mount_fdesc.c index 94133ec7b64..98dff956c01 100644 --- a/sbin/mount_fdesc/mount_fdesc.c +++ b/sbin/mount_fdesc/mount_fdesc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_fdesc.c,v 1.4 1997/01/15 23:41:19 millert Exp $ */ +/* $OpenBSD: mount_fdesc.c,v 1.5 1997/08/20 05:10:20 millert Exp $ */ /* $NetBSD: mount_fdesc.c,v 1.7 1996/04/13 01:31:15 jtc Exp $ */ /* @@ -48,7 +48,7 @@ char copyright[] = #if 0 static char sccsid[] = "@(#)mount_fdesc.c 8.2 (Berkeley) 3/27/94"; #else -static char rcsid[] = "$OpenBSD: mount_fdesc.c,v 1.4 1997/01/15 23:41:19 millert Exp $"; +static char rcsid[] = "$OpenBSD: mount_fdesc.c,v 1.5 1997/08/20 05:10:20 millert Exp $"; #endif #endif /* not lint */ @@ -56,6 +56,7 @@ static char rcsid[] = "$OpenBSD: mount_fdesc.c,v 1.4 1997/01/15 23:41:19 millert #include <sys/mount.h> #include <err.h> +#include <errno.h> #include <unistd.h> #include <stdio.h> #include <stdlib.h> @@ -93,8 +94,13 @@ main(argc, argv) if (argc != 2) usage(); - if (mount(MOUNT_FDESC, argv[1], mntflags, NULL)) - err(1, NULL); + if (mount(MOUNT_FDESC, argv[1], mntflags, NULL)) { + if (errno == EOPNOTSUPP) + errx(1, "%s: Filesystem not supported by kernel", + argv[1]); + else + err(1, argv[1]); + } exit(0); } |