aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-11-11 14:30:38 +0100
committerMax Kellermann <max@duempel.org>2009-11-11 14:30:38 +0100
commit96204ea3dc70521b6df1b01dd6f7c799e6d42ec1 (patch)
treefea9811dcf0b9c18c277f336a936ee1e85c469a9 /src
parent9d1a34e30b70e90a3b22cad136f1904a1d182021 (diff)
downloadmpd-96204ea3dc70521b6df1b01dd6f7c799e6d42ec1.tar.gz
mpd-96204ea3dc70521b6df1b01dd6f7c799e6d42ec1.tar.xz
mpd-96204ea3dc70521b6df1b01dd6f7c799e6d42ec1.zip
fd_util: don't call fd_set_nonblock() if open() has failed
This fixes an assertion failure.
Diffstat (limited to 'src')
-rw-r--r--src/fd_util.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/fd_util.c b/src/fd_util.c
index f2ec4fcb3..9c60d00ae 100644
--- a/src/fd_util.c
+++ b/src/fd_util.c
@@ -114,7 +114,8 @@ open_cloexec(const char *path_fs, int flags, int mode)
#endif
fd = open(path_fs, flags, mode);
- fd_set_cloexec(fd, true);
+ if (fd >= 0)
+ fd_set_cloexec(fd, true);
return fd;
}