diff --git a/sbin/mount_ados/mount_ados.c b/sbin/mount_ados/mount_ados.c index ac1b17424bd0..d5de26bd81ef 100644 --- a/sbin/mount_ados/mount_ados.c +++ b/sbin/mount_ados/mount_ados.c @@ -1,4 +1,4 @@ -/* $NetBSD: mount_ados.c,v 1.8 1998/03/01 02:20:11 fvdl Exp $ */ +/* $NetBSD: mount_ados.c,v 1.9 1999/06/25 19:28:35 perseant Exp $ */ /* * Copyright (c) 1994 Christopher G. Demetriou @@ -32,7 +32,7 @@ #include #ifndef lint -__RCSID("$NetBSD: mount_ados.c,v 1.8 1998/03/01 02:20:11 fvdl Exp $"); +__RCSID("$NetBSD: mount_ados.c,v 1.9 1999/06/25 19:28:35 perseant Exp $"); #endif /* not lint */ #include @@ -134,7 +134,7 @@ main(argc, argv) } if (mount(MOUNT_ADOSFS, dir, mntflags, &args) < 0) - err(1, "mount"); + err(1, "%s on %s", dev, dir); exit (0); } diff --git a/sbin/mount_cd9660/mount_cd9660.c b/sbin/mount_cd9660/mount_cd9660.c index dab373cdb15d..bb55deedf1a4 100644 --- a/sbin/mount_cd9660/mount_cd9660.c +++ b/sbin/mount_cd9660/mount_cd9660.c @@ -1,4 +1,4 @@ -/* $NetBSD: mount_cd9660.c,v 1.7 1999/05/28 10:10:25 mjl Exp $ */ +/* $NetBSD: mount_cd9660.c,v 1.8 1999/06/25 19:28:35 perseant Exp $ */ /* * Copyright (c) 1992, 1993, 1994 @@ -50,7 +50,7 @@ __COPYRIGHT("@(#) Copyright (c) 1992, 1993, 1994\n\ #if 0 static char sccsid[] = "@(#)mount_cd9660.c 8.7 (Berkeley) 5/1/95"; #else -__RCSID("$NetBSD: mount_cd9660.c,v 1.7 1999/05/28 10:10:25 mjl Exp $"); +__RCSID("$NetBSD: mount_cd9660.c,v 1.8 1999/06/25 19:28:35 perseant Exp $"); #endif #endif /* not lint */ @@ -124,7 +124,7 @@ main(argc, argv) args.flags = opts; if (mount(MOUNT_CD9660, dir, mntflags, &args) < 0) - err(1, "%s", ""); + err(1, "%s on %s", dev, dir); exit(0); } diff --git a/sbin/mount_fdesc/mount_fdesc.c b/sbin/mount_fdesc/mount_fdesc.c index 2ade121210b5..d6c21941a927 100644 --- a/sbin/mount_fdesc/mount_fdesc.c +++ b/sbin/mount_fdesc/mount_fdesc.c @@ -1,4 +1,4 @@ -/* $NetBSD: mount_fdesc.c,v 1.9 1997/09/16 12:26:56 lukem Exp $ */ +/* $NetBSD: mount_fdesc.c,v 1.10 1999/06/25 19:28:36 perseant Exp $ */ /* * Copyright (c) 1990, 1992 Jan-Simon Pendry @@ -47,7 +47,7 @@ __COPYRIGHT("@(#) Copyright (c) 1992, 1993, 1994\n\ #if 0 static char sccsid[] = "@(#)mount_fdesc.c 8.3 (Berkeley) 4/26/95"; #else -__RCSID("$NetBSD: mount_fdesc.c,v 1.9 1997/09/16 12:26:56 lukem Exp $"); +__RCSID("$NetBSD: mount_fdesc.c,v 1.10 1999/06/25 19:28:36 perseant Exp $"); #endif #endif /* not lint */ @@ -94,7 +94,7 @@ main(argc, argv) usage(); if (mount(MOUNT_FDESC, argv[1], mntflags, NULL)) - err(1, "%s", ""); + err(1, "fdesc on %s", argv[1]); exit(0); } diff --git a/sbin/mount_filecore/mount_filecore.c b/sbin/mount_filecore/mount_filecore.c index a72032704331..624dd29a64e7 100644 --- a/sbin/mount_filecore/mount_filecore.c +++ b/sbin/mount_filecore/mount_filecore.c @@ -1,4 +1,4 @@ -/* $NetBSD: mount_filecore.c,v 1.1 1998/08/14 03:38:51 mark Exp $ */ +/* $NetBSD: mount_filecore.c,v 1.2 1999/06/25 19:28:36 perseant Exp $ */ /* * Copyright (c) 1998 Andrew McMurry @@ -138,7 +138,7 @@ main(argc, argv) args.flags = opts; if (mount(MOUNT_FILECORE, dir, mntflags, &args) < 0) - err(1, "%s", ""); + err(1, "%s on %s", dev, dir); exit(0); } diff --git a/sbin/mount_kernfs/mount_kernfs.c b/sbin/mount_kernfs/mount_kernfs.c index c2c3cd44ab81..b4b7f9f27819 100644 --- a/sbin/mount_kernfs/mount_kernfs.c +++ b/sbin/mount_kernfs/mount_kernfs.c @@ -1,4 +1,4 @@ -/* $NetBSD: mount_kernfs.c,v 1.10 1997/09/16 12:29:16 lukem Exp $ */ +/* $NetBSD: mount_kernfs.c,v 1.11 1999/06/25 19:28:36 perseant Exp $ */ /* * Copyright (c) 1990, 1992 Jan-Simon Pendry @@ -47,7 +47,7 @@ __COPYRIGHT("@(#) Copyright (c) 1992, 1993, 1994\n\ #if 0 static char sccsid[] = "@(#)mount_kernfs.c 8.3 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: mount_kernfs.c,v 1.10 1997/09/16 12:29:16 lukem Exp $"); +__RCSID("$NetBSD: mount_kernfs.c,v 1.11 1999/06/25 19:28:36 perseant Exp $"); #endif #endif /* not lint */ @@ -94,7 +94,7 @@ main(argc, argv) usage(); if (mount(MOUNT_KERNFS, argv[1], mntflags, NULL)) - err(1, "%s", ""); + err(1, "kernfs on %s", argv[1]); exit(0); } diff --git a/sbin/mount_lfs/mount_lfs.c b/sbin/mount_lfs/mount_lfs.c index a842b9f91cdd..6b5c5c4b68e4 100644 --- a/sbin/mount_lfs/mount_lfs.c +++ b/sbin/mount_lfs/mount_lfs.c @@ -1,4 +1,4 @@ -/* $NetBSD: mount_lfs.c,v 1.7 1998/03/01 02:20:41 fvdl Exp $ */ +/* $NetBSD: mount_lfs.c,v 1.8 1999/06/25 19:28:36 perseant Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1993, 1994\n\ #if 0 static char sccsid[] = "@(#)mount_lfs.c 8.4 (Berkeley) 4/26/95"; #else -__RCSID("$NetBSD: mount_lfs.c,v 1.7 1998/03/01 02:20:41 fvdl Exp $"); +__RCSID("$NetBSD: mount_lfs.c,v 1.8 1999/06/25 19:28:36 perseant Exp $"); #endif #endif /* not lint */ @@ -53,6 +53,7 @@ __RCSID("$NetBSD: mount_lfs.c,v 1.7 1998/03/01 02:20:41 fvdl Exp $"); #include #include +#include #include #include #include @@ -81,6 +82,7 @@ main(argc, argv) struct ufs_args args; int ch, mntflags, noclean; char *fs_name, *options; + const char *errcause; options = NULL; mntflags = noclean = 0; @@ -108,7 +110,7 @@ main(argc, argv) if (argc != 2) usage(); - args.fspec = argv[0]; /* the name of the device file */ + args.fspec = argv[0]; /* the name of the device file */ fs_name = argv[1]; /* the mount point */ #define DEFAULT_ROOTUID -2 @@ -118,8 +120,24 @@ main(argc, argv) else args.export.ex_flags = 0; - if (mount(MOUNT_LFS, fs_name, mntflags, &args)) - err(1, "%s", ""); + if (mount(MOUNT_LFS, fs_name, mntflags, &args)) { + switch (errno) { + case EMFILE: + errcause = "mount table full"; + break; + case EINVAL: + if (mntflags & MNT_UPDATE) + errcause = + "specified device does not match mounted device"; + else + errcause = "incorrect super block"; + break; + default: + errcause = strerror(errno); + break; + } + errx(1, "%s on %s: %s", args.fspec, fs_name, errcause); + } if (!noclean) invoke_cleaner(fs_name); diff --git a/sbin/mount_msdos/mount_msdos.c b/sbin/mount_msdos/mount_msdos.c index ac8b37abda03..780b97e1ed82 100644 --- a/sbin/mount_msdos/mount_msdos.c +++ b/sbin/mount_msdos/mount_msdos.c @@ -1,4 +1,4 @@ -/* $NetBSD: mount_msdos.c,v 1.19 1998/03/01 02:20:45 fvdl Exp $ */ +/* $NetBSD: mount_msdos.c,v 1.20 1999/06/25 19:28:36 perseant Exp $ */ /* * Copyright (c) 1994 Christopher G. Demetriou @@ -32,7 +32,7 @@ #include #ifndef lint -__RCSID("$NetBSD: mount_msdos.c,v 1.19 1998/03/01 02:20:45 fvdl Exp $"); +__RCSID("$NetBSD: mount_msdos.c,v 1.20 1999/06/25 19:28:36 perseant Exp $"); #endif /* not lint */ #include @@ -146,7 +146,7 @@ main(argc, argv) } if (mount(MOUNT_MSDOS, dir, mntflags, &args) < 0) - err(1, "mount"); + err(1, "%s on %s", dev, dir); exit (0); } diff --git a/sbin/mount_nfs/mount_nfs.c b/sbin/mount_nfs/mount_nfs.c index 4afe6b05aa5e..c43e312804b9 100644 --- a/sbin/mount_nfs/mount_nfs.c +++ b/sbin/mount_nfs/mount_nfs.c @@ -1,4 +1,4 @@ -/* $NetBSD: mount_nfs.c,v 1.22 1998/05/14 07:44:09 tron Exp $ */ +/* $NetBSD: mount_nfs.c,v 1.23 1999/06/25 19:28:37 perseant Exp $ */ /* * Copyright (c) 1992, 1993, 1994 @@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1992, 1993, 1994\n\ #if 0 static char sccsid[] = "@(#)mount_nfs.c 8.11 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: mount_nfs.c,v 1.22 1998/05/14 07:44:09 tron Exp $"); +__RCSID("$NetBSD: mount_nfs.c,v 1.23 1999/06/25 19:28:37 perseant Exp $"); #endif #endif /* not lint */ @@ -205,7 +205,7 @@ main(argc, argv) struct nfs_args nfsargs; struct nfsd_cargs ncd; int mntflags, altflags, i, nfssvc_flag, num; - char *name, *p, *spec; + char *name, *p, *spec, *ospec; #ifdef NFSKERB uid_t last_ruid; @@ -431,11 +431,14 @@ main(argc, argv) spec = *argv++; name = *argv; + if((ospec = strdup(spec))==NULL) { + err(1,"strdup"); + } if (!getnfsargs(spec, nfsargsp)) exit(1); if (mount(MOUNT_NFS, name, mntflags, nfsargsp)) - err(1, "%s", name); + err(1, "%s on %s", ospec, name); if (nfsargsp->flags & (NFSMNT_NQNFS | NFSMNT_KERB)) { if ((opflags & ISBGRND) == 0) { if ((i = fork()) != 0) { diff --git a/sbin/mount_ntfs/mount_ntfs.c b/sbin/mount_ntfs/mount_ntfs.c index 850aadf4b85c..fe3ef428308c 100644 --- a/sbin/mount_ntfs/mount_ntfs.c +++ b/sbin/mount_ntfs/mount_ntfs.c @@ -1,4 +1,4 @@ -/* $NetBSD: mount_ntfs.c,v 1.2 1999/05/06 16:08:55 christos Exp $ */ +/* $NetBSD: mount_ntfs.c,v 1.3 1999/06/25 19:28:37 perseant Exp $ */ /* * Copyright (c) 1994 Christopher G. Demetriou @@ -35,7 +35,7 @@ */ #include #ifndef lint -__RCSID("$NetBSD: mount_ntfs.c,v 1.2 1999/05/06 16:08:55 christos Exp $"); +__RCSID("$NetBSD: mount_ntfs.c,v 1.3 1999/06/25 19:28:37 perseant Exp $"); #endif #include @@ -187,7 +187,7 @@ main(argc, argv) #else if (mount(MOUNT_NTFS, dir, mntflags, &args) < 0) #endif - err(EX_OSERR, "%s", dev); + err(EX_OSERR, "%s on %s", dev, dir); exit (0); } diff --git a/sbin/mount_null/mount_null.c b/sbin/mount_null/mount_null.c index 4b32b5a412df..e2b98d02f329 100644 --- a/sbin/mount_null/mount_null.c +++ b/sbin/mount_null/mount_null.c @@ -1,4 +1,4 @@ -/* $NetBSD: mount_null.c,v 1.5 1997/09/16 12:31:02 lukem Exp $ */ +/* $NetBSD: mount_null.c,v 1.6 1999/06/25 19:28:37 perseant Exp $ */ /* * Copyright (c) 1992, 1993, 1994 @@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1992, 1993, 1994\n\ #if 0 static char sccsid[] = "@(#)mount_null.c 8.6 (Berkeley) 4/26/95"; #else -__RCSID("$NetBSD: mount_null.c,v 1.5 1997/09/16 12:31:02 lukem Exp $"); +__RCSID("$NetBSD: mount_null.c,v 1.6 1999/06/25 19:28:37 perseant Exp $"); #endif #endif /* not lint */ @@ -106,7 +106,7 @@ main(argc, argv) args.target = target; if (mount(MOUNT_NULL, argv[1], mntflags, &args)) - err(1, "%s", ""); + err(1, "%s on %s", target, argv[1]); exit(0); } diff --git a/sbin/mount_procfs/mount_procfs.c b/sbin/mount_procfs/mount_procfs.c index be544f0ffdf1..e3299d7cb95e 100644 --- a/sbin/mount_procfs/mount_procfs.c +++ b/sbin/mount_procfs/mount_procfs.c @@ -1,4 +1,4 @@ -/* $NetBSD: mount_procfs.c,v 1.9 1997/09/16 12:32:04 lukem Exp $ */ +/* $NetBSD: mount_procfs.c,v 1.10 1999/06/25 19:28:37 perseant Exp $ */ /* * Copyright (c) 1990, 1992, 1993 Jan-Simon Pendry @@ -47,7 +47,7 @@ __COPYRIGHT("@(#) Copyright (c) 1992, 1993, 1994\n\ #if 0 static char sccsid[] = "@(#)mount_procfs.c 8.4 (Berkeley) 4/26/95"; #else -__RCSID("$NetBSD: mount_procfs.c,v 1.9 1997/09/16 12:32:04 lukem Exp $"); +__RCSID("$NetBSD: mount_procfs.c,v 1.10 1999/06/25 19:28:37 perseant Exp $"); #endif #endif /* not lint */ @@ -94,7 +94,7 @@ main(argc, argv) usage(); if (mount(MOUNT_PROCFS, argv[1], mntflags, NULL)) - err(1, "%s", ""); + err(1, "procfs on %s", argv[1]); exit(0); } diff --git a/sbin/mount_umap/mount_umap.c b/sbin/mount_umap/mount_umap.c index 34e42e0b3a45..e27b9d1566f9 100644 --- a/sbin/mount_umap/mount_umap.c +++ b/sbin/mount_umap/mount_umap.c @@ -1,4 +1,4 @@ -/* $NetBSD: mount_umap.c,v 1.8 1999/06/01 19:16:49 perseant Exp $ */ +/* $NetBSD: mount_umap.c,v 1.9 1999/06/25 19:28:37 perseant Exp $ */ /* * Copyright (c) 1992, 1993, 1994 @@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1992, 1993, 1994\n\ #if 0 static char sccsid[] = "@(#)mount_umap.c 8.5 (Berkeley) 4/26/95"; #else -__RCSID("$NetBSD: mount_umap.c,v 1.8 1999/06/01 19:16:49 perseant Exp $"); +__RCSID("$NetBSD: mount_umap.c,v 1.9 1999/06/25 19:28:37 perseant Exp $"); #endif #endif /* not lint */ @@ -230,7 +230,7 @@ main(argc, argv) args.gmapdata = gmapdata; if (mount(MOUNT_UMAP, argv[1], mntflags, &args)) - err(1, "%s", ""); + err(1, "%s on %s", source, argv[1]); exit(0); } diff --git a/sbin/mount_union/mount_union.c b/sbin/mount_union/mount_union.c index 841ca8553685..45b930b2eaaa 100644 --- a/sbin/mount_union/mount_union.c +++ b/sbin/mount_union/mount_union.c @@ -1,4 +1,4 @@ -/* $NetBSD: mount_union.c,v 1.5 1997/09/16 12:32:54 lukem Exp $ */ +/* $NetBSD: mount_union.c,v 1.6 1999/06/25 19:28:38 perseant Exp $ */ /* * Copyright (c) 1992, 1993, 1994 @@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1992, 1993, 1994\n\ #if 0 static char sccsid[] = "@(#)mount_union.c 8.6 (Berkeley) 4/26/95"; #else -__RCSID("$NetBSD: mount_union.c,v 1.5 1997/09/16 12:32:54 lukem Exp $"); +__RCSID("$NetBSD: mount_union.c,v 1.6 1999/06/25 19:28:38 perseant Exp $"); #endif #endif /* not lint */ @@ -117,7 +117,7 @@ main(argc, argv) args.target = target; if (mount(MOUNT_UNION, argv[1], mntflags, &args)) - err(1, "%s", ""); + err(1, "%s on %s", target, argv[1]); exit(0); }