We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ac1edd4 commit 1e515d2Copy full SHA for 1e515d2
1 file changed
src/process.c
@@ -84,6 +84,19 @@ void process_start(int app_index)
84
else if(pid == 0)
85
{
86
// Child process
87
+ // Close inherited file descriptors (except stdin/stdout/stderr)
88
+ int max_fd = (int)sysconf(_SC_OPEN_MAX);
89
+
90
+ if(max_fd < 0)
91
+ {
92
+ max_fd = 1024; // Fallback if sysconf fails
93
+ }
94
95
+ for(int fd = 3; fd < max_fd; fd++)
96
97
+ close(fd);
98
99
100
// Reset signals to default
101
struct sigaction sa;
102
sa.sa_handler = SIG_DFL;
0 commit comments