diff options
author | cperciva <cperciva@FreeBSD.org> | 2005-03-26 04:45:53 +0000 |
---|---|---|
committer | cperciva <cperciva@FreeBSD.org> | 2005-03-26 04:45:53 +0000 |
commit | a59a08fc46cdc92dca6428a64996cff6677507df (patch) | |
tree | 9f9612458a91c3980ab10ebbdc3d52154b2aa2c2 /sbin/mount | |
parent | 45abe5fea18096424b899b1043ad3901b640e858 (diff) | |
download | FreeBSD-src-a59a08fc46cdc92dca6428a64996cff6677507df.zip FreeBSD-src-a59a08fc46cdc92dca6428a64996cff6677507df.tar.gz |
When executing mount_foo, pass "mount_foo" as argv[0] instead of "foo".
This unbreaks "/rescue/mount -t foo" -- previously it was necessary to
explicitly call "/rescue/mount_foo".
Hints from: gordon
X-MFC after: 3 days (if approved by re@)
Diffstat (limited to 'sbin/mount')
-rw-r--r-- | sbin/mount/mount.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c index 4ce8b81..6494426 100644 --- a/sbin/mount/mount.c +++ b/sbin/mount/mount.c @@ -437,8 +437,11 @@ mountfs(vfstype, spec, name, flags, options, mntopts) if (strcmp(vfstype, "msdos") == 0) vfstype = "msdosfs"; + /* Construct the name of the appropriate mount command */ + (void)snprintf(execname, sizeof(execname), "mount_%s", vfstype); + argc = 0; - argv[argc++] = vfstype; + argv[argc++] = execname; mangle(optbuf, &argc, argv); argv[argc++] = spec; argv[argc++] = name; @@ -462,7 +465,6 @@ mountfs(vfstype, spec, name, flags, options, mntopts) exit(mount_ufs(argc, (char * const *) argv)); /* Go find an executable. */ - (void)snprintf(execname, sizeof(execname), "mount_%s", vfstype); execvP(execname, _PATH_SYSPATH, (char * const *)argv); if (errno == ENOENT) { warn("exec mount_%s not found in %s", vfstype, |