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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user