Commit 96204ea3 authored by Max Kellermann's avatar Max Kellermann

fd_util: don't call fd_set_nonblock() if open() has failed

This fixes an assertion failure.
parent 9d1a34e3
...@@ -114,7 +114,8 @@ open_cloexec(const char *path_fs, int flags, int mode) ...@@ -114,7 +114,8 @@ open_cloexec(const char *path_fs, int flags, int mode)
#endif #endif
fd = open(path_fs, flags, mode); fd = open(path_fs, flags, mode);
fd_set_cloexec(fd, true); if (fd >= 0)
fd_set_cloexec(fd, true);
return fd; return fd;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment