os_calls: Add g_file_{get,set}_cloexec() functions

Allows us to avoid file descriptor leaks when running a new executable
This commit is contained in:
matt335672
2023-04-21 12:20:24 +01:00
parent 184287d81e
commit b811fdb36b
3 changed files with 46 additions and 3 deletions
+1 -3
View File
@@ -73,12 +73,10 @@ internal_log_file_open(const char *fname)
}
}
#ifdef FD_CLOEXEC
if (ret != -1)
{
fcntl(ret, F_SETFD, FD_CLOEXEC);
g_file_set_cloexec(ret, 1);
}
#endif
return ret;
}