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 | |
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')
-rw-r--r-- | sbin/mount_ados/mount_ados.c | 14 | ||||
-rw-r--r-- | sbin/mount_cd9660/mount_cd9660.c | 13 | ||||
-rw-r--r-- | sbin/mount_ext2fs/mount_ext2fs.c | 7 | ||||
-rw-r--r-- | sbin/mount_fdesc/mount_fdesc.c | 14 | ||||
-rw-r--r-- | sbin/mount_ffs/mount_ffs.c | 7 | ||||
-rw-r--r-- | sbin/mount_nfs/mount_nfs.c | 10 | ||||
-rw-r--r-- | sbin/mount_null/mount_null.c | 14 | ||||
-rw-r--r-- | sbin/mount_portal/mount_portal.c | 14 | ||||
-rw-r--r-- | sbin/mount_procfs/mount_procfs.c | 14 | ||||
-rw-r--r-- | sbin/mount_umap/mount_umap.c | 14 | ||||
-rw-r--r-- | sbin/mount_union/mount_union.c | 14 |
11 files changed, 93 insertions, 42 deletions
diff --git a/sbin/mount_ados/mount_ados.c b/sbin/mount_ados/mount_ados.c index 07e3ad7ca5c..7fb2f7178a6 100644 --- a/sbin/mount_ados/mount_ados.c +++ b/sbin/mount_ados/mount_ados.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_ados.c,v 1.5 1997/01/15 23:41:16 millert Exp $ */ +/* $OpenBSD: mount_ados.c,v 1.6 1997/08/20 05:10:17 millert Exp $ */ /* $NetBSD: mount_ados.c,v 1.5 1996/04/13 01:30:59 jtc Exp $ */ /* @@ -32,7 +32,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: mount_ados.c,v 1.5 1997/01/15 23:41:16 millert Exp $"; +static char rcsid[] = "$OpenBSD: mount_ados.c,v 1.6 1997/08/20 05:10:17 millert Exp $"; #endif /* not lint */ #include <sys/cdefs.h> @@ -41,6 +41,7 @@ static char rcsid[] = "$OpenBSD: mount_ados.c,v 1.5 1997/01/15 23:41:16 millert #include <sys/stat.h> #include <ctype.h> #include <err.h> +#include <errno.h> #include <grp.h> #include <pwd.h> #include <stdio.h> @@ -130,9 +131,12 @@ main(argc, argv) args.mask = sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO); } - if (mount(MOUNT_ADOSFS, dir, mntflags, &args) < 0) - err(1, "mount"); - + if (mount(MOUNT_ADOSFS, dir, mntflags, &args) < 0) { + if (errno == EOPNOTSUPP) + errx(1, "%s: Filesystem not supported by kernel", dir); + else + err(1, dir); + } exit (0); } diff --git a/sbin/mount_cd9660/mount_cd9660.c b/sbin/mount_cd9660/mount_cd9660.c index 8d44a555269..42d689a0ccd 100644 --- a/sbin/mount_cd9660/mount_cd9660.c +++ b/sbin/mount_cd9660/mount_cd9660.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_cd9660.c,v 1.6 1997/04/19 20:10:13 deraadt Exp $ */ +/* $OpenBSD: mount_cd9660.c,v 1.7 1997/08/20 05:10:18 millert Exp $ */ /* $NetBSD: mount_cd9660.c,v 1.3 1996/04/13 01:31:08 jtc Exp $ */ /* @@ -49,7 +49,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)mount_cd9660.c 8.4 (Berkeley) 3/27/94"; #else -static char rcsid[] = "$OpenBSD: mount_cd9660.c,v 1.6 1997/04/19 20:10:13 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: mount_cd9660.c,v 1.7 1997/08/20 05:10:18 millert Exp $"; #endif #endif /* not lint */ @@ -58,6 +58,7 @@ static char rcsid[] = "$OpenBSD: mount_cd9660.c,v 1.6 1997/04/19 20:10:13 deraad #include <sys/mount.h> #include <err.h> +#include <errno.h> #include <stdlib.h> #include <stdio.h> #include <string.h> @@ -123,8 +124,12 @@ main(argc, argv) args.export.ex_flags = 0; args.flags = opts; - if (mount(MOUNT_CD9660, dir, mntflags, &args) < 0) - err(1, NULL); + if (mount(MOUNT_CD9660, dir, mntflags, &args) < 0) { + if (errno == EOPNOTSUPP) + errx(1, "%s: Filesystem not supported by kernel", dir); + else + err(1, dir); + } exit(0); } diff --git a/sbin/mount_ext2fs/mount_ext2fs.c b/sbin/mount_ext2fs/mount_ext2fs.c index 9167520cfb5..7af72de2ce9 100644 --- a/sbin/mount_ext2fs/mount_ext2fs.c +++ b/sbin/mount_ext2fs/mount_ext2fs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_ext2fs.c,v 1.5 1997/06/20 14:40:00 kstailey Exp $ */ +/* $OpenBSD: mount_ext2fs.c,v 1.6 1997/08/20 05:10:19 millert Exp $ */ /* $NetBSD: mount_ffs.c,v 1.3 1996/04/13 01:31:19 jtc Exp $ */ /*- @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)mount_ufs.c 8.2 (Berkeley) 3/27/94"; #else -static char rcsid[] = "$OpenBSD: mount_ext2fs.c,v 1.5 1997/06/20 14:40:00 kstailey Exp $"; +static char rcsid[] = "$OpenBSD: mount_ext2fs.c,v 1.6 1997/08/20 05:10:19 millert Exp $"; #endif #endif /* not lint */ @@ -114,6 +114,9 @@ main(argc, argv) errcause = "specified device does not match mounted device"; break; + case EOPNOTSUPP: + errcause = "filesystem not supported by kernel"; + break; default: errcause = strerror(errno); break; 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); } diff --git a/sbin/mount_ffs/mount_ffs.c b/sbin/mount_ffs/mount_ffs.c index ff71634694f..66a93fc2720 100644 --- a/sbin/mount_ffs/mount_ffs.c +++ b/sbin/mount_ffs/mount_ffs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_ffs.c,v 1.6 1997/06/20 14:07:46 kstailey Exp $ */ +/* $OpenBSD: mount_ffs.c,v 1.7 1997/08/20 05:10:21 millert Exp $ */ /* $NetBSD: mount_ffs.c,v 1.3 1996/04/13 01:31:19 jtc Exp $ */ /*- @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)mount_ufs.c 8.2 (Berkeley) 3/27/94"; #else -static char rcsid[] = "$OpenBSD: mount_ffs.c,v 1.6 1997/06/20 14:07:46 kstailey Exp $"; +static char rcsid[] = "$OpenBSD: mount_ffs.c,v 1.7 1997/08/20 05:10:21 millert Exp $"; #endif #endif /* not lint */ @@ -117,6 +117,9 @@ main(argc, argv) errcause = "specified device does not match mounted device"; break; + case EINVAL: + errcause = "filesystem not supported by kernel"; + break; default: errcause = strerror(errno); break; diff --git a/sbin/mount_nfs/mount_nfs.c b/sbin/mount_nfs/mount_nfs.c index 2a4c7cd849c..1c3c3c3fd10 100644 --- a/sbin/mount_nfs/mount_nfs.c +++ b/sbin/mount_nfs/mount_nfs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_nfs.c,v 1.12 1997/08/18 03:11:24 millert Exp $ */ +/* $OpenBSD: mount_nfs.c,v 1.13 1997/08/20 05:10:23 millert Exp $ */ /* $NetBSD: mount_nfs.c,v 1.12.4.1 1996/05/25 22:48:05 fvdl Exp $ */ /* @@ -433,8 +433,12 @@ main(argc, argv) if (!getnfsargs(spec, nfsargsp)) exit(1); - if (mount(MOUNT_NFS, name, mntflags, nfsargsp)) - err(1, "%s", name); + if (mount(MOUNT_NFS, name, mntflags, nfsargsp)) { + if (errno == EOPNOTSUPP) + errx(1, "%s: Filesystem not supported by kernel", name); + else + err(1, name); + } if (nfsargsp->flags & (NFSMNT_NQNFS | NFSMNT_KERB)) { if ((opflags & ISBGRND) == 0) { if (i = fork()) { diff --git a/sbin/mount_null/mount_null.c b/sbin/mount_null/mount_null.c index fd49f42e586..54b1caa3317 100644 --- a/sbin/mount_null/mount_null.c +++ b/sbin/mount_null/mount_null.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_null.c,v 1.4 1997/01/15 23:41:23 millert Exp $ */ +/* $OpenBSD: mount_null.c,v 1.5 1997/08/20 05:10:24 millert Exp $ */ /* $NetBSD: mount_null.c,v 1.3 1996/04/13 01:31:49 jtc Exp $ */ /* @@ -47,7 +47,7 @@ char copyright[] = #if 0 static char sccsid[] = "@(#)mount_null.c 8.5 (Berkeley) 3/27/94"; #else -static char rcsid[] = "$OpenBSD: mount_null.c,v 1.4 1997/01/15 23:41:23 millert Exp $"; +static char rcsid[] = "$OpenBSD: mount_null.c,v 1.5 1997/08/20 05:10:24 millert Exp $"; #endif #endif /* not lint */ @@ -56,6 +56,7 @@ static char rcsid[] = "$OpenBSD: mount_null.c,v 1.4 1997/01/15 23:41:23 millert #include <miscfs/nullfs/null.h> #include <err.h> +#include <errno.h> #include <stdio.h> #include <unistd.h> #include <stdlib.h> @@ -105,8 +106,13 @@ main(argc, argv) args.target = target; - if (mount(MOUNT_NULL, argv[1], mntflags, &args)) - err(1, NULL); + if (mount(MOUNT_NULL, argv[1], mntflags, &args)) { + if (errno == EOPNOTSUPP) + errx(1, "%s: Filesystem not supported by kernel", + argv[1]); + else + err(1, argv[1]); + } exit(0); } diff --git a/sbin/mount_portal/mount_portal.c b/sbin/mount_portal/mount_portal.c index a6f38b3a81c..af96e341bf3 100644 --- a/sbin/mount_portal/mount_portal.c +++ b/sbin/mount_portal/mount_portal.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_portal.c,v 1.12 1997/08/04 19:25:19 deraadt Exp $ */ +/* $OpenBSD: mount_portal.c,v 1.13 1997/08/20 05:10:25 millert Exp $ */ /* $NetBSD: mount_portal.c,v 1.8 1996/04/13 01:31:54 jtc Exp $ */ /* @@ -47,7 +47,7 @@ char copyright[] = #if 0 static char sccsid[] = "@(#)mount_portal.c 8.6 (Berkeley) 4/26/95"; #else -static char rcsid[] = "$OpenBSD: mount_portal.c,v 1.12 1997/08/04 19:25:19 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: mount_portal.c,v 1.13 1997/08/20 05:10:25 millert Exp $"; #endif #endif /* not lint */ @@ -129,7 +129,6 @@ main(argc, argv) int fdssize; qelem q; - int rc; int so; int error = 0; @@ -201,9 +200,12 @@ main(argc, argv) */ openlog("portald", LOG_CONS|LOG_PID, LOG_DAEMON); - rc = mount(MOUNT_PORTAL, mountpt, mntflags, &args); - if (rc < 0) { - syslog(LOG_ERR, "mount: %m"); + if (mount(MOUNT_PORTAL, mountpt, mntflags, &args)) { + if (errno == EOPNOTSUPP) + syslog(LOG_ERR, + "mount: Filesystem not supported by kernel"); + else + syslog(LOG_ERR, "mount: %m"); exit(1); } diff --git a/sbin/mount_procfs/mount_procfs.c b/sbin/mount_procfs/mount_procfs.c index f03ec7d76d6..40eb98951d8 100644 --- a/sbin/mount_procfs/mount_procfs.c +++ b/sbin/mount_procfs/mount_procfs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_procfs.c,v 1.4 1997/01/15 23:41:25 millert Exp $ */ +/* $OpenBSD: mount_procfs.c,v 1.5 1997/08/20 05:10:26 millert Exp $ */ /* $NetBSD: mount_procfs.c,v 1.7 1996/04/13 01:31:59 jtc Exp $ */ /* @@ -48,7 +48,7 @@ char copyright[] = #if 0 static char sccsid[] = "@(#)mount_procfs.c 8.3 (Berkeley) 3/27/94"; #else -static char rcsid[] = "$OpenBSD: mount_procfs.c,v 1.4 1997/01/15 23:41:25 millert Exp $"; +static char rcsid[] = "$OpenBSD: mount_procfs.c,v 1.5 1997/08/20 05:10:26 millert Exp $"; #endif #endif /* not lint */ @@ -56,6 +56,7 @@ static char rcsid[] = "$OpenBSD: mount_procfs.c,v 1.4 1997/01/15 23:41:25 miller #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_PROCFS, argv[1], mntflags, NULL)) - err(1, NULL); + if (mount(MOUNT_PROCFS, argv[1], mntflags, NULL)) { + if (errno == EOPNOTSUPP) + errx(1, "%s: Filesystem not supported by kernel", + argv[1]); + else + err(1, argv[1]); + } exit(0); } diff --git a/sbin/mount_umap/mount_umap.c b/sbin/mount_umap/mount_umap.c index 1c8cf67453a..b34c03e1e64 100644 --- a/sbin/mount_umap/mount_umap.c +++ b/sbin/mount_umap/mount_umap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_umap.c,v 1.5 1997/01/15 23:41:26 millert Exp $ */ +/* $OpenBSD: mount_umap.c,v 1.6 1997/08/20 05:10:27 millert Exp $ */ /* $NetBSD: mount_umap.c,v 1.5 1996/04/13 01:32:05 jtc Exp $ */ /* @@ -47,7 +47,7 @@ char copyright[] = #if 0 static char sccsid[] = "@(#)mount_umap.c 8.3 (Berkeley) 3/27/94"; #else -static char rcsid[] = "$OpenBSD: mount_umap.c,v 1.5 1997/01/15 23:41:26 millert Exp $"; +static char rcsid[] = "$OpenBSD: mount_umap.c,v 1.6 1997/08/20 05:10:27 millert Exp $"; #endif #endif /* not lint */ @@ -58,6 +58,7 @@ static char rcsid[] = "$OpenBSD: mount_umap.c,v 1.5 1997/01/15 23:41:26 millert #include <miscfs/umapfs/umap.h> #include <err.h> +#include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -230,8 +231,13 @@ main(argc, argv) args.gnentries = gnentries; args.gmapdata = gmapdata; - if (mount(MOUNT_UMAP, argv[1], mntflags, &args)) - err(1, NULL); + if (mount(MOUNT_UMAP, argv[1], mntflags, &args)) { + if (errno == EOPNOTSUPP) + errx(1, "%s: Filesystem not supported by kernel", + argv[1]); + else + err(1, argv[1]); + } exit(0); } diff --git a/sbin/mount_union/mount_union.c b/sbin/mount_union/mount_union.c index 6650fe9c69b..7ba1ad8b830 100644 --- a/sbin/mount_union/mount_union.c +++ b/sbin/mount_union/mount_union.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_union.c,v 1.4 1997/01/15 23:41:27 millert Exp $ */ +/* $OpenBSD: mount_union.c,v 1.5 1997/08/20 05:10:28 millert Exp $ */ /* $NetBSD: mount_union.c,v 1.3 1996/04/13 01:32:11 jtc Exp $ */ /* @@ -47,7 +47,7 @@ char copyright[] = #if 0 static char sccsid[] = "@(#)mount_union.c 8.5 (Berkeley) 3/27/94"; #else -static char rcsid[] = "$OpenBSD: mount_union.c,v 1.4 1997/01/15 23:41:27 millert Exp $"; +static char rcsid[] = "$OpenBSD: mount_union.c,v 1.5 1997/08/20 05:10:28 millert Exp $"; #endif #endif /* not lint */ @@ -57,6 +57,7 @@ static char rcsid[] = "$OpenBSD: mount_union.c,v 1.4 1997/01/15 23:41:27 millert #include <miscfs/union/union.h> #include <err.h> +#include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -116,8 +117,13 @@ main(argc, argv) args.target = target; - if (mount(MOUNT_UNION, argv[1], mntflags, &args)) - err(1, NULL); + if (mount(MOUNT_UNION, argv[1], mntflags, &args)) { + if (errno == EOPNOTSUPP) + errx(1, "%s: Filesystem not supported by kernel", + argv[1]); + else + err(1, argv[1]); + } exit(0); } |