mirror of
https://github.com/bellard/quickjs.git
synced 2025-09-30 06:54:26 +03:00
Improve js_os_exec
(#295)
- use $(shell) make command to test if closefrom() is available - use closefrom() if available in js_os_exec() - limit the fallback loop to 1024 handles to avoid costly loop on linux alpine. PR inspired by @nicolas-duteil-nova
This commit is contained in:
5
Makefile
5
Makefile
@@ -143,6 +143,11 @@ endif
|
||||
ifdef CONFIG_WIN32
|
||||
DEFINES+=-D__USE_MINGW_ANSI_STDIO # for standard snprintf behavior
|
||||
endif
|
||||
ifndef CONFIG_WIN32
|
||||
ifeq ($(shell $(CC) -o /dev/null compat/test-closefrom.c 2>/dev/null && echo 1),1)
|
||||
DEFINES+=-DHAVE_CLOSEFROM
|
||||
endif
|
||||
endif
|
||||
|
||||
CFLAGS+=$(DEFINES)
|
||||
CFLAGS_DEBUG=$(CFLAGS) -O0
|
||||
|
Reference in New Issue
Block a user