mirror of
https://github.com/janet-lang/janet
synced 2024-11-28 19:19:53 +00:00
Merge pull request #378 from andrewchambers/tweak
Tweak comment, remove extra include.
This commit is contained in:
commit
95c669389b
@ -33,7 +33,6 @@
|
||||
#include <fcntl.h>
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
static int cfun_io_gc(void *p, size_t len);
|
||||
@ -143,10 +142,9 @@ static Janet cfun_io_temp(int32_t argc, Janet *argv) {
|
||||
|
||||
#ifndef JANET_WINDOWS
|
||||
/* It seems highly unlikely a typical janet user wants a tempfile to be inherited and
|
||||
libc tmpfile does NOT set O_CLOEXEC by default,
|
||||
libc tmpfile does NOT set O_CLOEXEC by default.
|
||||
|
||||
Even though setting this flag after a delay is racy in threaded programs,
|
||||
It helps in single threaded ones. The fix for threaded programs would be to use mkostemp
|
||||
For threaded programs we should use mkostemp
|
||||
which is coming to POSIX at a later time. */
|
||||
if (fcntl(fileno(tmp), F_SETFD, FD_CLOEXEC) != 0) {
|
||||
fclose(tmp);
|
||||
|
Loading…
Reference in New Issue
Block a user