Fix set_cloexec check

Fixes #8023.
This commit is contained in:
Fabian Homborg 2021-05-22 18:09:15 +02:00
parent e81b3e06c5
commit fe4eaba563

View File

@ -255,7 +255,7 @@ int open_cloexec(const char *path, int flags, mode_t mode) {
fd = open(path, flags | O_CLOEXEC, mode);
#else
fd = open(path, flags, mode);
if (fd >= 0 && !set_cloexec(fd)) {
if (fd >= 0 && set_cloexec(fd)) {
exec_close(fd);
fd = -1;
}