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:
parent
b3b73720f2
commit
6e34b4796d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=144133
@ -437,8 +437,11 @@ mountfs(vfstype, spec, name, flags, options, mntopts)
|
|||||||
if (strcmp(vfstype, "msdos") == 0)
|
if (strcmp(vfstype, "msdos") == 0)
|
||||||
vfstype = "msdosfs";
|
vfstype = "msdosfs";
|
||||||
|
|
||||||
|
/* Construct the name of the appropriate mount command */
|
||||||
|
(void)snprintf(execname, sizeof(execname), "mount_%s", vfstype);
|
||||||
|
|
||||||
argc = 0;
|
argc = 0;
|
||||||
argv[argc++] = vfstype;
|
argv[argc++] = execname;
|
||||||
mangle(optbuf, &argc, argv);
|
mangle(optbuf, &argc, argv);
|
||||||
argv[argc++] = spec;
|
argv[argc++] = spec;
|
||||||
argv[argc++] = name;
|
argv[argc++] = name;
|
||||||
@ -462,7 +465,6 @@ mountfs(vfstype, spec, name, flags, options, mntopts)
|
|||||||
exit(mount_ufs(argc, (char * const *) argv));
|
exit(mount_ufs(argc, (char * const *) argv));
|
||||||
|
|
||||||
/* Go find an executable. */
|
/* Go find an executable. */
|
||||||
(void)snprintf(execname, sizeof(execname), "mount_%s", vfstype);
|
|
||||||
execvP(execname, _PATH_SYSPATH, (char * const *)argv);
|
execvP(execname, _PATH_SYSPATH, (char * const *)argv);
|
||||||
if (errno == ENOENT) {
|
if (errno == ENOENT) {
|
||||||
warn("exec mount_%s not found in %s", vfstype,
|
warn("exec mount_%s not found in %s", vfstype,
|
||||||
|
Loading…
Reference in New Issue
Block a user