summaryrefslogtreecommitdiff
path: root/e2fsck/unix.c
diff options
context:
space:
mode:
Diffstat (limited to 'e2fsck/unix.c')
-rw-r--r--e2fsck/unix.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/e2fsck/unix.c b/e2fsck/unix.c
index 279849f3..fb67f6a9 100644
--- a/e2fsck/unix.c
+++ b/e2fsck/unix.c
@@ -254,6 +254,11 @@ static void reserve_stdio_fds(NOARGS)
fd = open("/dev/null", O_RDWR);
if (fd > 2)
break;
+ if (fd < 0) {
+ fprintf(stderr, "ERROR: Couldn't open /dev/null (%s)\n",
+ strerror(errno));
+ break;
+ }
}
close(fd);
}