aboutsummaryrefslogtreecommitdiffstats
path: root/syscall.c
diff options
context:
space:
mode:
authorDavid Dykstra <dwd@samba.org>1999-11-04 15:43:38 +0000
committerDavid Dykstra <dwd@samba.org>1999-11-04 15:43:38 +0000
commit3420c8e6e06f316e0e7f99eba3f5c957cd0d3106 (patch)
treedc2d48f5d81325a15e9c1b675c375ef3336230f9 /syscall.c
parentb17bc22bb3fc0c64092f31a31acbe21947c775ab (diff)
downloadandroid_external_rsync-3420c8e6e06f316e0e7f99eba3f5c957cd0d3106.tar.gz
android_external_rsync-3420c8e6e06f316e0e7f99eba3f5c957cd0d3106.tar.bz2
android_external_rsync-3420c8e6e06f316e0e7f99eba3f5c957cd0d3106.zip
Fixed bug introduced by calling do_open() for O_RDONLY files. Changed it
so the check for dry_run and CHECK_RO are not done when flags is O_RDONLY. Only do the adding of O_BINARY, which was the intention.
Diffstat (limited to 'syscall.c')
-rw-r--r--syscall.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/syscall.c b/syscall.c
index 58760664..d5b567f6 100644
--- a/syscall.c
+++ b/syscall.c
@@ -76,12 +76,14 @@ int do_rmdir(char *pathname)
int do_open(char *pathname, int flags, mode_t mode)
{
- if (dry_run) return -1;
+ if (flags != O_RDONLY) {
+ if (dry_run) return -1;
+ CHECK_RO
+ }
#ifdef O_BINARY
/* for Windows */
flags |= O_BINARY;
#endif
- CHECK_RO
return open(pathname, flags, mode);
}