From 6e34b4796ddb57be97f31b96bc0df416e816a399 Mon Sep 17 00:00:00 2001 From: Colin Percival Date: Sat, 26 Mar 2005 04:45:53 +0000 Subject: [PATCH] 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@) --- sbin/mount/mount.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c index 4ce8b81d6661..64944261473d 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,