fd = failtest_open("run-open-scratchpad", "run-open.c", 1,
O_RDWR|O_CREAT, 0600);
if (fd == -1) {
/* We are the child: write error code for parent to check. */
err = errno;
fd = failtest_open("run-open-scratchpad", "run-open.c", 1,
O_RDWR|O_CREAT, 0600);
if (fd == -1) {
/* We are the child: write error code for parent to check. */
err = errno;
fd = failtest_open("run-open-scratchpad", "run-open.c", 1, O_RDONLY);
if (fd == -1) {
/* We are the child: write error code for parent to check. */
err = errno;
fd = failtest_open("run-open-scratchpad", "run-open.c", 1, O_RDONLY);
if (fd == -1) {
/* We are the child: write error code for parent to check. */
err = errno;