- fd = open("run-write-scratchpad", O_RDWR|O_CREAT, 0600);
- write(fd, buf, strlen(buf));
+ fd = failtest_open("run-write-scratchpad", __FILE__, __LINE__,
+ O_RDWR|O_CREAT, 0600);
+ /* Child will fail, ignore. */
+ if (fd < 0)
+ failtest_exit(0);
+ if (write(fd, buf, strlen(buf)) != strlen(buf))
+ abort();