diff options
Diffstat (limited to 'sbin/mount')
-rw-r--r-- | sbin/mount/mount.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c index 1be00ec..5dbe573 100644 --- a/sbin/mount/mount.c +++ b/sbin/mount/mount.c @@ -327,13 +327,28 @@ mountfs(vfstype, spec, name, flags, options, mntopts) exit(mount_ufs(argc, (char * const *) argv)); /* Go find an executable. */ - edir = edirs; - do { + for (edir = edirs; *edir; edir++) { (void)snprintf(execname, sizeof(execname), "%s/mount_%s", *edir, vfstype); execv(execname, (char * const *)argv); - warn("exec %s for %s", execname, name); - } while (*++edir != NULL); + } + if (errno == ENOENT) { + int len = 0; + char *cp; + for (edir = edirs; *edir; edir++) + len += strlen(*edir) + 2; /* ", " */ + if ((cp = malloc(len)) == NULL) { + warn(NULL); + exit(1); + } + cp[0] = '\0'; + for (edir = edirs; *edir; edir++) { + strcat(cp, *edir); + if (edir[1] != NULL) + strcat(cp, ", "); + } + warn("exec mount_%s not found in %s", vfstype, cp); + } exit(1); /* NOTREACHED */ default: /* Parent. */ |