Check all lseek calls succeed.

Also add missing TEMP_FAILURE_RETRYs on read, write, and lseek.

Bug: http://b/20625546
Change-Id: I03b198e11c1921b35518ee2dd005a7cfcf4fd94b
This commit is contained in:
Elliott Hughes
2015-04-29 17:46:43 -07:00
parent 8c389e9c76
commit 7bad7c4646
14 changed files with 112 additions and 128 deletions
+1 -1
View File
@@ -78,7 +78,7 @@ int main(int argc __attribute__((unused)), char **argv __attribute__((unused)))
snprintf(fn, sizeof(fn), "%s/%s", kPartitions[i], "dirty");
fd = open(fn, O_WRONLY|O_CREAT, 0444);
if (fd >= 0) { // Don't sweat it if we can't write the file.
write(fd, fn, sizeof(fn)); // write, you know, some data
TEMP_FAILURE_RETRY(write(fd, fn, sizeof(fn))); // write, you know, some data
close(fd);
unlink(fn);
}