When mounting a ro fs rw, print warning and then mount it ro. Patch

from Dave Cinege.
 -Erik
This commit is contained in:
Eric Andersen 2000-09-20 06:23:36 +00:00
parent b938e2ff99
commit 0cccdfaf36
2 changed files with 8 additions and 0 deletions

View File

@ -144,6 +144,10 @@ do_mount(char *specialfile, char *dir, char *filesystemtype,
}
#endif
status = mount(specialfile, dir, filesystemtype, flags, string_flags);
if (errno == EROFS) {
errorMsg("%s is write-protected, mounting read-only\n", specialfile);
status = mount(specialfile, dir, filesystemtype, flags |= MS_RDONLY, string_flags);
}
}

View File

@ -144,6 +144,10 @@ do_mount(char *specialfile, char *dir, char *filesystemtype,
}
#endif
status = mount(specialfile, dir, filesystemtype, flags, string_flags);
if (errno == EROFS) {
errorMsg("%s is write-protected, mounting read-only\n", specialfile);
status = mount(specialfile, dir, filesystemtype, flags |= MS_RDONLY, string_flags);
}
}