mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-06 13:41:28 +00:00
improved uwsgi_run_command
This commit is contained in:
+21
-1
@@ -3295,7 +3295,27 @@ pid_t uwsgi_run_command(char *command, int *stdin_fd, int stdout_fd) {
|
||||
}
|
||||
|
||||
uwsgi_close_all_sockets();
|
||||
uwsgi_close_all_fds();
|
||||
//uwsgi_close_all_fds();
|
||||
int i;
|
||||
for (i = 3; i < (int) uwsgi.max_fd; i++) {
|
||||
if (stdin_fd) {
|
||||
if (i == stdin_fd[0] || i == stdin_fd[1]) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (stdout_fd > -1) {
|
||||
if (i == stdout_fd) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
#ifdef __APPLE__
|
||||
fcntl(i, F_SETFD, FD_CLOEXEC);
|
||||
#else
|
||||
close(i);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (stdin_fd) {
|
||||
close(stdin_fd[1]);
|
||||
|
||||
Reference in New Issue
Block a user