From 0cccdfaf363171c9f0761fbdb2028db0ea73e6b5 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Wed, 20 Sep 2000 06:23:36 +0000 Subject: When mounting a ro fs rw, print warning and then mount it ro. Patch from Dave Cinege. -Erik --- util-linux/mount.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'util-linux') diff --git a/util-linux/mount.c b/util-linux/mount.c index 455c333..eefbd76 100644 --- a/util-linux/mount.c +++ b/util-linux/mount.c @@ -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); + } } -- cgit v1.1