mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-06 13:41:28 +00:00
dup2() returns < 0 on error
This commit is contained in:
+1
-1
@@ -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);
|
||||
}
|
||||
|
||||
+1
-1
@@ -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);
|
||||
}
|
||||
|
||||
+2
-2
@@ -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);
|
||||
}
|
||||
|
||||
+1
-1
@@ -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()");
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -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()");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user