aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--toys/posix/cpio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/posix/cpio.c b/toys/posix/cpio.c
index 4817403f..8263de3e 100644
--- a/toys/posix/cpio.c
+++ b/toys/posix/cpio.c
@@ -141,7 +141,7 @@ void cpio_main(void)
}
size -= sizeof(toybuf);
}
- close(fd);
+ if (!test) close(fd);
} else if (!test)
err = mknod(name, mode, makedev(x8u(toybuf+62), x8u(toybuf+70)));