diff options
| author | Jeff Sharkey <jsharkey@android.com> | 2012-09-13 15:11:42 -0700 |
|---|---|---|
| committer | Jeff Sharkey <jsharkey@android.com> | 2012-09-13 15:11:42 -0700 |
| commit | 6de702679089fab13ec2d4d435054f68688df545 (patch) | |
| tree | 18f00be1006ac3a65e02930fd84ff6974d36dcca /libcutils | |
| parent | ddb173394430a7b55b0c24896a843556f5f8de7a (diff) | |
| download | system_core-6de702679089fab13ec2d4d435054f68688df545.tar.gz system_core-6de702679089fab13ec2d4d435054f68688df545.tar.bz2 system_core-6de702679089fab13ec2d4d435054f68688df545.zip | |
Wrap more system calls in TEMP_FAILURE_RETRY.
Bug: 7151474
Change-Id: I9fe19746104cf392f88ea5cf8061e2e21e334671
Diffstat (limited to 'libcutils')
| -rw-r--r-- | libcutils/fs.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libcutils/fs.c b/libcutils/fs.c index 6508b6787..a9889b2bf 100644 --- a/libcutils/fs.c +++ b/libcutils/fs.c @@ -73,14 +73,14 @@ fixup: } int fs_read_atomic_int(const char* path, int* out_value) { - int fd = open(path, O_RDONLY); + int fd = TEMP_FAILURE_RETRY(open(path, O_RDONLY)); if (fd == -1) { ALOGE("Failed to read %s: %s", path, strerror(errno)); return -1; } char buf[BUF_SIZE]; - if (read(fd, buf, BUF_SIZE) == -1) { + if (TEMP_FAILURE_RETRY(read(fd, buf, BUF_SIZE)) == -1) { ALOGE("Failed to read %s: %s", path, strerror(errno)); goto fail; } @@ -104,7 +104,7 @@ int fs_write_atomic_int(const char* path, int value) { return -1; } - int fd = mkstemp(temp); + int fd = TEMP_FAILURE_RETRY(mkstemp(temp)); if (fd == -1) { ALOGE("Failed to open %s: %s", temp, strerror(errno)); return -1; @@ -116,7 +116,7 @@ int fs_write_atomic_int(const char* path, int value) { ALOGE("Value %d too large: %s", value, strerror(errno)); goto fail; } - if (write(fd, buf, len) < len) { + if (TEMP_FAILURE_RETRY(write(fd, buf, len)) < len) { ALOGE("Failed to write %s: %s", temp, strerror(errno)); goto fail; } |
