diff --git a/core/daemons.c b/core/daemons.c index 1239cf1a..a8796d67 100644 --- a/core/daemons.c +++ b/core/daemons.c @@ -215,7 +215,7 @@ void uwsgi_spawn_daemon(struct uwsgi_daemon *ud) { exit(1); } if (devnull != 0) { - if (dup2(devnull, 0)) { + if (dup2(devnull, 0) < 0) { uwsgi_error("dup2()"); exit(1); } diff --git a/core/emperor.c b/core/emperor.c index b922ebaa..db72e049 100644 --- a/core/emperor.c +++ b/core/emperor.c @@ -729,7 +729,7 @@ void emperor_add(struct uwsgi_emperor_scanner *ues, char *name, time_t born, cha exit(1); } if (stdin_fd != 0) { - if (dup2(stdin_fd, 0)) { + if (dup2(stdin_fd, 0) < 0) { uwsgi_error("dup2()"); exit(1); } diff --git a/core/socket.c b/core/socket.c index d88703e4..ef294025 100644 --- a/core/socket.c +++ b/core/socket.c @@ -1632,7 +1632,7 @@ void uwsgi_map_sockets() { exit(1); } if (fd != uwsgi_sock->fd) { - if (dup2(fd, uwsgi_sock->fd)) { + if (dup2(fd, uwsgi_sock->fd) < 0) { uwsgi_error("dup2()"); exit(1); } @@ -1744,7 +1744,7 @@ void uwsgi_bind_sockets() { exit(1); } if (fd != 0) { - if (dup2(fd, 0)) { + if (dup2(fd, 0) < 0) { uwsgi_error("dup2()"); exit(1); } diff --git a/core/utils.c b/core/utils.c index 6fc0694d..57ef1bfb 100644 --- a/core/utils.c +++ b/core/utils.c @@ -3335,7 +3335,7 @@ pid_t uwsgi_run_command(char *command, int *stdin_fd, int stdout_fd) { } else { if (in_fd != 0) { - if (dup2(in_fd, 0)) { + if (dup2(in_fd, 0) < 0) { uwsgi_error("dup2()"); } } diff --git a/core/uwsgi.c b/core/uwsgi.c index 2dca85c9..3e9dba5e 100644 --- a/core/uwsgi.c +++ b/core/uwsgi.c @@ -2738,7 +2738,7 @@ next2: } if (uwsgi.sockets->fd != 0) { - if (dup2(uwsgi.sockets->fd, 0)) { + if (dup2(uwsgi.sockets->fd, 0) < 0) { uwsgi_error("dup2()"); } }