]> git.ozlabs.org Git - ccan/blobdiff - ccan/failtest/test/run-write.c
failtest: rely on the save/restore of files, don't use write cleanup.
[ccan] / ccan / failtest / test / run-write.c
index 5425517030a5d77f1db0b22926c30956d54bf183..d3d7c6041871c96884e28c488a0f86a1982a9f24 100644 (file)
@@ -15,7 +15,11 @@ int main(void)
 
        plan_tests(5);
 
-       fd = open("run-write-scratchpad", O_RDWR|O_CREAT, 0600);
+       fd = failtest_open("run-write-scratchpad", "run-write.c", 1,
+                          O_RDWR|O_CREAT, 0600);
+       /* Child will fail, ignore. */
+       if (fd < 0)
+               failtest_exit(0);
        write(fd, buf, strlen(buf));
        ok1(lseek(fd, 0, SEEK_CUR) == strlen(buf));