mkswap: do not do extra seek

mount: add another mount helper call method
This commit is contained in:
Denis Vlasenko
2008-02-03 23:52:41 +00:00
parent c85bfcad52
commit 32d49bc70f
3 changed files with 28 additions and 3 deletions

View File

@ -309,6 +309,27 @@ static int mount_it_now(struct mntent *mp, int vfsflags, char *filteropts)
for (;;) {
rc = mount(mp->mnt_fsname, mp->mnt_dir, mp->mnt_type,
vfsflags, filteropts);
// If mount failed, try
// helper program <mnt_type>
if (ENABLE_FEATURE_MOUNT_HELPERS && rc) {
char *args[6];
int errno_save = errno;
args[0] = mp->mnt_type;
rc = 1;
if (filteropts) {
args[rc++] = (char *)"-o";
args[rc++] = filteropts;
}
args[rc++] = mp->mnt_fsname;
args[rc++] = mp->mnt_dir;
args[rc] = NULL;
rc = wait4pid(spawn(args));
if (!rc)
break;
errno = errno_save;
}
if (!rc || (vfsflags & MS_RDONLY) || (errno != EACCES && errno != EROFS))
break;
if (!(vfsflags & MS_SILENT))