diff options
author | Theodore Ts'o <tytso@mit.edu> | 1999-05-18 03:16:36 +0000 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 1999-05-18 03:16:36 +0000 |
commit | 75d83bec5ff7c29d68f725b75b72e3465f1378df (patch) | |
tree | 46776101730e2606c75758719d3b06359c0bf536 /e2fsck | |
parent | 4eca93be214a4a68e1dff3de508e69d719763aaa (diff) | |
download | e2fsprogs-75d83bec5ff7c29d68f725b75b72e3465f1378df.tar.gz |
unix.c, ChangeLog:
unix.c (reserve_stdio_fds): Add safety check in case reserve_stdio_fds
couldn't open /dev/null.
Diffstat (limited to 'e2fsck')
-rw-r--r-- | e2fsck/ChangeLog | 5 | ||||
-rw-r--r-- | e2fsck/unix.c | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index 04efa41e..c93d12cf 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -1,3 +1,8 @@ +1999-05-17 <tytso@rsts-11.mit.edu> + + * unix.c (reserve_stdio_fds): Add safety check in case + reserve_stdio_fds couldn't open /dev/null. + 1999-03-14 Theodore Ts'o <tytso@rsts-11.mit.edu> * util.c (print_resource_track): Use mallinfo if present to get 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); } |