summaryrefslogtreecommitdiffstats
path: root/adb/file_sync_service.c
diff options
context:
space:
mode:
Diffstat (limited to 'adb/file_sync_service.c')
-rw-r--r--adb/file_sync_service.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/adb/file_sync_service.c b/adb/file_sync_service.c
index e6f64bb1b..793385851 100644
--- a/adb/file_sync_service.c
+++ b/adb/file_sync_service.c
@@ -183,18 +183,18 @@ static int handle_send_file(int s, char *path, uid_t uid,
unsigned int timestamp = 0;
int fd;
- fd = adb_open_mode(path, O_WRONLY | O_CREAT | O_EXCL, mode);
+ fd = adb_open_mode(path, O_WRONLY | O_CREAT | O_EXCL | O_CLOEXEC, mode);
if(fd < 0 && errno == ENOENT) {
if(mkdirs(path) != 0) {
if(fail_errno(s))
return -1;
fd = -1;
} else {
- fd = adb_open_mode(path, O_WRONLY | O_CREAT | O_EXCL, mode);
+ fd = adb_open_mode(path, O_WRONLY | O_CREAT | O_EXCL | O_CLOEXEC, mode);
}
}
if(fd < 0 && errno == EEXIST) {
- fd = adb_open_mode(path, O_WRONLY, mode);
+ fd = adb_open_mode(path, O_WRONLY | O_CLOEXEC, mode);
}
if(fd < 0) {
if(fail_errno(s))
@@ -388,7 +388,7 @@ static int do_recv(int s, const char *path, char *buffer)
syncmsg msg;
int fd, r;
- fd = adb_open(path, O_RDONLY);
+ fd = adb_open(path, O_RDONLY | O_CLOEXEC);
if(fd < 0) {
if(fail_errno(s)) return -1;
return 0;