diff options
author | Elliott Hughes <enh@google.com> | 2015-04-30 06:11:41 +0200 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-04-30 06:11:41 +0200 |
commit | 34c7731a0bb296a1289b85a83f53026117aa3677 (patch) | |
tree | e2c357667b0e76e6fa5a43c7a7951c872c373e9c /fuse_sideload.c | |
parent | Merge "Stop using adb_strtok, and check argument validity." (diff) | |
parent | Check all lseek calls succeed. (diff) | |
download | android_bootable_recovery-34c7731a0bb296a1289b85a83f53026117aa3677.tar android_bootable_recovery-34c7731a0bb296a1289b85a83f53026117aa3677.tar.gz android_bootable_recovery-34c7731a0bb296a1289b85a83f53026117aa3677.tar.bz2 android_bootable_recovery-34c7731a0bb296a1289b85a83f53026117aa3677.tar.lz android_bootable_recovery-34c7731a0bb296a1289b85a83f53026117aa3677.tar.xz android_bootable_recovery-34c7731a0bb296a1289b85a83f53026117aa3677.tar.zst android_bootable_recovery-34c7731a0bb296a1289b85a83f53026117aa3677.zip |
Diffstat (limited to 'fuse_sideload.c')
-rw-r--r-- | fuse_sideload.c | 16 |
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))); } } |