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@)
This commit is contained in:
Colin Percival 2005-03-26 04:45:53 +00:00
parent b3b73720f2
commit 6e34b4796d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=144133

View File

@ -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,