fd_util: don't call fd_set_nonblock() if open() has failed
This fixes an assertion failure.
This commit is contained in:
parent
9d1a34e30b
commit
96204ea3dc
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user