summaryrefslogtreecommitdiffstats
path: root/fuse_sideload.c
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2015-04-29 02:24:24 +0200
committerElliott Hughes <enh@google.com>2015-04-30 06:14:56 +0200
commit2f5feedf1d705b53e5bf90c8b5207dd91f4522f1 (patch)
treee2c357667b0e76e6fa5a43c7a7951c872c373e9c /fuse_sideload.c
parentStop using adb_strtok, and check argument validity. (diff)
downloadandroid_bootable_recovery-2f5feedf1d705b53e5bf90c8b5207dd91f4522f1.tar
android_bootable_recovery-2f5feedf1d705b53e5bf90c8b5207dd91f4522f1.tar.gz
android_bootable_recovery-2f5feedf1d705b53e5bf90c8b5207dd91f4522f1.tar.bz2
android_bootable_recovery-2f5feedf1d705b53e5bf90c8b5207dd91f4522f1.tar.lz
android_bootable_recovery-2f5feedf1d705b53e5bf90c8b5207dd91f4522f1.tar.xz
android_bootable_recovery-2f5feedf1d705b53e5bf90c8b5207dd91f4522f1.tar.zst
android_bootable_recovery-2f5feedf1d705b53e5bf90c8b5207dd91f4522f1.zip
Diffstat (limited to '')
-rw-r--r--fuse_sideload.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/fuse_sideload.c b/fuse_sideload.c
index 1dd84e97a..48e6cc53a 100644
--- a/fuse_sideload.c
+++ b/fuse_sideload.c
@@ -442,14 +442,12 @@ int run_fuse_sideload(struct provider_vtab* vtab, void* cookie,
}
uint8_t request_buffer[sizeof(struct fuse_in_header) + PATH_MAX*8];
for (;;) {
- ssize_t len = read(fd.ffd, request_buffer, sizeof(request_buffer));
- if (len < 0) {
- if (errno != EINTR) {
- perror("read request");
- if (errno == ENODEV) {
- result = -1;
- break;
- }
+ ssize_t len = TEMP_FAILURE_RETRY(read(fd.ffd, request_buffer, sizeof(request_buffer)));
+ if (len == -1) {
+ perror("read request");
+ if (errno == ENODEV) {
+ result = -1;
+ break;
}
continue;
}
@@ -508,7 +506,7 @@ int run_fuse_sideload(struct provider_vtab* vtab, void* cookie,
outhdr.len = sizeof(outhdr);
outhdr.error = result;
outhdr.unique = hdr->unique;
- write(fd.ffd, &outhdr, sizeof(outhdr));
+ TEMP_FAILURE_RETRY(write(fd.ffd, &outhdr, sizeof(outhdr)));
}
}