nginx-0.0.2-2004-02-09-10:46:43 import
diff --git a/src/core/nginx.c b/src/core/nginx.c
index 6340356..fe78ab4 100644
--- a/src/core/nginx.c
+++ b/src/core/nginx.c
@@ -377,8 +377,11 @@
                                      ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
                                                    "can not respawn %s",
                                                    ngx_processes[i].name);
+                                     continue;
                                  }
 
+                                 live = 1;
+
                                  continue;
                             }
 
@@ -443,7 +446,7 @@
 
                     if (ngx_reopen) {
                         if (ngx_process == NGX_PROCESS_MASTER) {
-                            if (ccf->worker_reopen > 0) {
+                            if (ccf->worker_reopen != 0) {
                                 signo = ngx_signal_value(NGX_REOPEN_SIGNAL);
                                 ngx_reopen = 0;
 
@@ -461,7 +464,7 @@
                         ngx_log_error(NGX_LOG_INFO, cycle->log, 0,
                                       "reopening logs");
                         ngx_reopen_files(cycle,
-                                       ccf->worker_reopen > 0 ? ccf->user : -1);
+                             ccf->worker_reopen != 0 ? ccf->user : (uid_t) -1);
                     }
                 }
 
@@ -574,6 +577,17 @@
         }
     }
 
+#if (HAVE_PR_SET_DUMPABLE)
+
+    /* allow coredump after setuid() in Linux 2.4.x */
+
+    if (prctl(PR_SET_DUMPABLE, 1, 0, 0, 0) == -1) {
+        ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
+                      "prctl(PR_SET_DUMPABLE) failed");
+    }
+
+#endif
+
     sigemptyset(&set);
 
     if (sigprocmask(SIG_SETMASK, &set, NULL) == -1) {
diff --git a/src/core/ngx_config.h b/src/core/ngx_config.h
index b691c3c..83f410a 100644
--- a/src/core/ngx_config.h
+++ b/src/core/ngx_config.h
@@ -2,7 +2,7 @@
 #define _NGX_CONFIG_H_INCLUDED_
 
 
-#if 1
+#if 0
 /* STUB to allocate a big ngx_connections */
 #undef  FD_SETSIZE
 #define FD_SETSIZE  5000
diff --git a/src/core/ngx_connection.c b/src/core/ngx_connection.c
index 8833c2b..e0b24fa 100644
--- a/src/core/ngx_connection.c
+++ b/src/core/ngx_connection.c
@@ -48,11 +48,6 @@
             return NGX_ERROR;
         }
 
-/* STUB: autoconf & set sin_len in ls[i].sockaddr in ngx_http.c */
-#if __FreeBSD__
-        addr_in->sin_len = 0;
-#endif
-
         ls[i].family = addr_in->sin_family;
         ls[i].addr_text.len = ngx_sock_ntop(ls[i].family, ls[i].sockaddr,
                                             ls[i].addr_text.data,
@@ -68,11 +63,11 @@
 
 ngx_int_t ngx_open_listening_sockets(ngx_cycle_t *cycle)
 {
-    int              tries, failed, reuseaddr, i;
-    ngx_err_t        err;
-    ngx_log_t       *log;
-    ngx_socket_t     s;
-    ngx_listening_t *ls;
+    ngx_int_t         tries, failed, reuseaddr, i;
+    ngx_err_t         err;
+    ngx_log_t        *log;
+    ngx_socket_t      s;
+    ngx_listening_t  *ls;
 
     reuseaddr = 1;
 #if (NGX_SUPPRESS_WARN)
@@ -241,3 +236,39 @@
         cycle->connections[fd].fd = -1;
     }
 }
+
+
+ngx_int_t ngx_connection_error(ngx_connection_t *c, ngx_err_t err, char *text)
+{
+    ngx_int_t  level;
+
+    if (err == NGX_ECONNRESET
+        && c->read->log_error == NGX_ERROR_IGNORE_ECONNRESET)
+    {
+        return 0;
+    }
+
+    if (err == NGX_ECONNRESET || err == NGX_EPIPE || err == NGX_ENOTCONN) {
+
+        switch (c->read->log_error) {
+
+        case NGX_ERROR_INFO:
+            level = NGX_LOG_INFO;
+            break;
+
+        case NGX_ERROR_ERR:
+            level = NGX_LOG_ERR;
+            break;
+
+        default:
+            level = NGX_LOG_CRIT;
+        }
+
+    } else {
+        level = NGX_LOG_CRIT;
+    }
+
+    ngx_log_error(level, c->log, err, text);
+
+    return NGX_ERROR;
+}
diff --git a/src/core/ngx_connection.h b/src/core/ngx_connection.h
index 5f2cc4f..6f87fd2 100644
--- a/src/core/ngx_connection.h
+++ b/src/core/ngx_connection.h
@@ -96,6 +96,7 @@
 ngx_int_t ngx_set_inherited_sockets(ngx_cycle_t *cycle);
 ngx_int_t ngx_open_listening_sockets(ngx_cycle_t *cycle);
 void ngx_close_listening_sockets(ngx_cycle_t *cycle);
+ngx_int_t ngx_connection_error(ngx_connection_t *c, ngx_err_t err, char *text);
 
 
 extern ngx_os_io_t  ngx_io;