aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2000-09-20 06:23:36 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2000-09-20 06:23:36 +0000
commit835f3d5ad342954c91aad5abc1fe0f86089661c1 (patch)
treec12a333e62bab534b5fb6c559f31ab924ed90d23
parent57b13b872c30d06213ede54da87da1e647fa669b (diff)
downloadbusybox-w32-835f3d5ad342954c91aad5abc1fe0f86089661c1.tar.gz
busybox-w32-835f3d5ad342954c91aad5abc1fe0f86089661c1.tar.bz2
busybox-w32-835f3d5ad342954c91aad5abc1fe0f86089661c1.zip
When mounting a ro fs rw, print warning and then mount it ro. Patch
from Dave Cinege. -Erik git-svn-id: svn://busybox.net/trunk/busybox@1075 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r--mount.c4
-rw-r--r--util-linux/mount.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/mount.c b/mount.c
index 455c33303..eefbd76fd 100644
--- a/mount.c
+++ b/mount.c
@@ -144,6 +144,10 @@ do_mount(char *specialfile, char *dir, char *filesystemtype,
144 } 144 }
145#endif 145#endif
146 status = mount(specialfile, dir, filesystemtype, flags, string_flags); 146 status = mount(specialfile, dir, filesystemtype, flags, string_flags);
147 if (errno == EROFS) {
148 errorMsg("%s is write-protected, mounting read-only\n", specialfile);
149 status = mount(specialfile, dir, filesystemtype, flags |= MS_RDONLY, string_flags);
150 }
147 } 151 }
148 152
149 153
diff --git a/util-linux/mount.c b/util-linux/mount.c
index 455c33303..eefbd76fd 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -144,6 +144,10 @@ do_mount(char *specialfile, char *dir, char *filesystemtype,
144 } 144 }
145#endif 145#endif
146 status = mount(specialfile, dir, filesystemtype, flags, string_flags); 146 status = mount(specialfile, dir, filesystemtype, flags, string_flags);
147 if (errno == EROFS) {
148 errorMsg("%s is write-protected, mounting read-only\n", specialfile);
149 status = mount(specialfile, dir, filesystemtype, flags |= MS_RDONLY, string_flags);
150 }
147 } 151 }
148 152
149 153