diff options
author | Max Kellermann <max@duempel.org> | 2008-03-26 10:37:06 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-03-26 10:37:06 +0000 |
commit | 33e88ff8f96627920c63b2d05dc16cb7ae15f318 (patch) | |
tree | ef152b410a24afceb409f5cd4aac3415b333e4a8 /src/log.c | |
parent | c6ceceae8a7f8b592c63086daa8f2269fb71ca08 (diff) | |
download | mpd-33e88ff8f96627920c63b2d05dc16cb7ae15f318.tar.gz mpd-33e88ff8f96627920c63b2d05dc16cb7ae15f318.tar.xz mpd-33e88ff8f96627920c63b2d05dc16cb7ae15f318.zip |
zero is a valid file descriptor
Although it may not happen in mpd code, it is perfectly possible for a
newly allocated file descriptor to be zero. For theoretical
correctness, allow 0.
git-svn-id: https://svn.musicpd.org/mpd/trunk@7194 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r-- | src/log.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -36,8 +36,8 @@ static const char *err_filename; static void redirect_logs(void) { - assert(out_fd > 0); - assert(err_fd > 0); + assert(out_fd >= 0); + assert(err_fd >= 0); if (dup2(out_fd, STDOUT_FILENO) < 0) FATAL("problems dup2 stdout : %s\n", strerror(errno)); if (dup2(err_fd, STDERR_FILENO) < 0) @@ -241,8 +241,8 @@ void close_log_files(void) { if (stdout_mode) return; - assert(out_fd > 0); - assert(err_fd > 0); + assert(out_fd >= 0); + assert(err_fd >= 0); xclose(out_fd); xclose(err_fd); } |