mirror of
https://github.com/bellard/quickjs.git
synced 2025-09-27 05:38:45 +03:00
fix: remove "#if defined(HAVE_CLOSEFROM)"
This commit is contained in:
parent
a555f9d893
commit
e45f2d6dea
@ -3112,6 +3112,7 @@ static JSValue js_os_exec(JSContext *ctx, JSValueConst this_val,
|
|||||||
}
|
}
|
||||||
if (pid == 0) {
|
if (pid == 0) {
|
||||||
/* child */
|
/* child */
|
||||||
|
int fd_max = sysconf(_SC_OPEN_MAX);
|
||||||
|
|
||||||
/* remap the stdin/stdout/stderr handles if necessary */
|
/* remap the stdin/stdout/stderr handles if necessary */
|
||||||
for(i = 0; i < 3; i++) {
|
for(i = 0; i < 3; i++) {
|
||||||
@ -3120,12 +3121,6 @@ static JSValue js_os_exec(JSContext *ctx, JSValueConst this_val,
|
|||||||
_exit(127);
|
_exit(127);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if defined(HAVE_CLOSEFROM)
|
|
||||||
/* closefrom() is available on many recent unix systems:
|
|
||||||
Linux with glibc 2.34+, Solaris 9+, FreeBSD 7.3+,
|
|
||||||
NetBSD 3.0+, OpenBSD 3.5+.
|
|
||||||
Linux with the musl libc and macOS don't have it.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
int pid = getpid();
|
int pid = getpid();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user