diff options
| author | Garrett Wollman <wollman@FreeBSD.org> | 1996-05-14 15:16:49 +0000 |
|---|---|---|
| committer | Garrett Wollman <wollman@FreeBSD.org> | 1996-05-14 15:16:49 +0000 |
| commit | 0d0a40202c843e263250ad3984f9dd0ecab2b7ea (patch) | |
| tree | 88fe896c9edb54d757a46adc1af4a2801af4a4bf | |
| parent | 1bccdd4ade597354fa5c78ccfed3b2060b4e069a (diff) | |
Notes
| -rw-r--r-- | sbin/mount_std/mount_std.8 | 12 | ||||
| -rw-r--r-- | sbin/mount_std/mount_std.c | 20 |
2 files changed, 23 insertions, 9 deletions
diff --git a/sbin/mount_std/mount_std.8 b/sbin/mount_std/mount_std.8 index f8d22a42cddb..15fc65e8be3c 100644 --- a/sbin/mount_std/mount_std.8 +++ b/sbin/mount_std/mount_std.8 @@ -34,7 +34,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id$ +.\" $Id: mount_std.8,v 1.1 1996/05/13 17:43:16 wollman Exp $ .\" .Dd May 13, 1996 .Dt MOUNT_STD 8 @@ -80,7 +80,11 @@ it was called) to determine the type of filesystem to be mounted. If it is called by a name which does not end in .Dq Li _ Ns Ar fsname , .Nm -will issue a diagnostic and return an error. The +will assume (for compatibility +with +.Xr mount 8 ) +that the zeroth argument contains only the name of the filesystem type. +The .Nm command is normally installed with appropriate links to commands for the distributed filesystems which can be mounted in this way; @@ -93,8 +97,8 @@ command. .It argv[0] must end in _fsname The .Nm mount_std -command was called with a zero'th argument which does not specify a -filesystem type to be mounted. +command was called with a zero'th argument of +.Dq Li mount_std . .It vfsload(%s) .Nm was unable to load a kernel module implementing the %s filesystem diff --git a/sbin/mount_std/mount_std.c b/sbin/mount_std/mount_std.c index 5d0615a1ac61..6ca3339e45f8 100644 --- a/sbin/mount_std/mount_std.c +++ b/sbin/mount_std/mount_std.c @@ -43,7 +43,7 @@ char copyright[] = #ifndef lint static const char rcsid[] = - "$Id$"; + "$Id: mount_std.c,v 1.1 1996/05/13 17:43:16 wollman Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -74,11 +74,21 @@ main(argc, argv) int ch, mntflags; struct vfsconf *vfc; + /* + * XXX + * mount(8) calls the mount programs with an argv[0] which is + * /just/ the filesystem name. So, if there is no underscore + * in argv[0], we assume that we are being called from mount(8) + * and that argv[0] is thus the name of the filesystem type. + */ fsname = strrchr(argv[0], '_'); - if (!fsname || strcmp(fsname, "_std") == 0) - errx(EX_USAGE, "argv[0] must end in _fsname"); - - fsname++; + if (fsname) { + if (strcmp(fsname, "_std") == 0) + errx(EX_USAGE, "argv[0] must end in _fsname"); + fsname++; + } else { + fsname = argv[0]; + } mntflags = 0; while ((ch = getopt(argc, argv, "o:")) != EOF) |
