dup2() returns < 0 on error

This commit is contained in:
Roberto De Ioris
2012-12-12 15:02:37 +01:00
parent 54fa0ab19f
commit d968e9f39e
5 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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()");
}
}