fd_util: don't call fd_set_nonblock() if open() has failed
This fixes an assertion failure.
This commit is contained in:
@@ -114,6 +114,7 @@ open_cloexec(const char *path_fs, int flags, int mode)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
fd = open(path_fs, flags, mode);
|
fd = open(path_fs, flags, mode);
|
||||||
|
if (fd >= 0)
|
||||||
fd_set_cloexec(fd, true);
|
fd_set_cloexec(fd, true);
|
||||||
|
|
||||||
return fd;
|
return fd;
|
||||||
|
Reference in New Issue
Block a user