aboutsummaryrefslogtreecommitdiffstats
path: root/toolbox
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-03-29 08:55:26 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-29 08:55:26 -0700
commit455a6dffd4db929f46b9c5a1e1f5b541b9721bfe (patch)
tree075aee4f41d5be70b03ae971bf7300780319194a /toolbox
parent0b022b894215ce8c14da1a6ce236ed9c694ef78a (diff)
parent7be77b5ba8ae21dad91019a02bc2c5d38dba081f (diff)
downloadsystem_core-455a6dffd4db929f46b9c5a1e1f5b541b9721bfe.tar.gz
system_core-455a6dffd4db929f46b9c5a1e1f5b541b9721bfe.tar.bz2
system_core-455a6dffd4db929f46b9c5a1e1f5b541b9721bfe.zip
Merge branch 'open_source' into google_internal
Diffstat (limited to 'toolbox')
-rw-r--r--toolbox/mount.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/toolbox/mount.c b/toolbox/mount.c
index ef13e1fd..395c9433 100644
--- a/toolbox/mount.c
+++ b/toolbox/mount.c
@@ -138,14 +138,17 @@ do_mount(char *dev, char *dir, char *type, unsigned long rwflag, void *data, int
if (loop) {
int file_fd, device_fd;
+ int flags;
+
+ flags = (rwflag & MS_RDONLY) ? O_RDONLY : O_RDWR;
// FIXME - only one loop mount supported at a time
- file_fd = open(dev, O_RDWR);
+ file_fd = open(dev, flags);
if (file_fd < -1) {
perror("open backing file failed");
return 1;
}
- device_fd = open(LOOP_DEVICE, O_RDWR);
+ device_fd = open(LOOP_DEVICE, flags);
if (device_fd < -1) {
perror("open loop device failed");
close(file_fd);