diff --git a/emperor.c b/emperor.c index cd0a2946..409cab94 100644 --- a/emperor.c +++ b/emperor.c @@ -395,6 +395,10 @@ void emperor_add(char *name, time_t born, char *config, uint32_t config_size, ui // close all of the unneded fd for(i=3;i<(int)uwsgi.max_fd;i++) { + if (n_ui->use_config) { + if (i == n_ui->pipe_config[1]) + continue; + } if (i != n_ui->pipe[1]) { close(i); } @@ -653,7 +657,9 @@ reconnect: ssize_t rlen = read(interesting_fd, &byte, 1); if (rlen <= 0) { // SAFE - emperor_del(ui_current); + if (!ui_current->config_len) { + emperor_del(ui_current); + } } else { if (byte == 17) { diff --git a/socket.c b/socket.c index 1d8aa1e5..3108c7c4 100644 --- a/socket.c +++ b/socket.c @@ -777,7 +777,7 @@ void uwsgi_socket_nb(int fd) { int timed_connect(struct pollfd *fdpoll, const struct sockaddr *addr, int addr_size, int timeout, int async) { int arg, ret; - int soopt; + int soopt = 0; socklen_t solen = sizeof(int); int cnt; /* set non-blocking socket */ @@ -847,7 +847,6 @@ int timed_connect(struct pollfd *fdpoll, const struct sockaddr *addr, int addr_s } - return 0; }