diff options
author | Elliott Hughes <enh@google.com> | 2015-04-30 06:19:33 +0200 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-04-30 06:19:33 +0200 |
commit | 34d3a3d074e977cace29797c428795e1de5b3223 (patch) | |
tree | e2c357667b0e76e6fa5a43c7a7951c872c373e9c /fuse_sideload.c | |
parent | am 8c389e9c: Merge "Stop using adb_strtok, and check argument validity." (diff) | |
parent | Merge "Check all lseek calls succeed." (diff) | |
download | android_bootable_recovery-34d3a3d074e977cace29797c428795e1de5b3223.tar android_bootable_recovery-34d3a3d074e977cace29797c428795e1de5b3223.tar.gz android_bootable_recovery-34d3a3d074e977cace29797c428795e1de5b3223.tar.bz2 android_bootable_recovery-34d3a3d074e977cace29797c428795e1de5b3223.tar.lz android_bootable_recovery-34d3a3d074e977cace29797c428795e1de5b3223.tar.xz android_bootable_recovery-34d3a3d074e977cace29797c428795e1de5b3223.tar.zst android_bootable_recovery-34d3a3d074e977cace29797c428795e1de5b3223.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))); } } |