]> granicus.if.org Git - apache/commitdiff
Let CGI daemon die if the network layer has been shut down (problem noticed on BS2000...
authorMartin Kraemer <martin@apache.org>
Tue, 29 Jun 2004 13:48:20 +0000 (13:48 +0000)
committerMartin Kraemer <martin@apache.org>
Tue, 29 Jun 2004 13:48:20 +0000 (13:48 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104080 13f79535-47bb-0310-9956-ffa450edef68

modules/generators/mod_cgid.c

index cb31f87d20d77031dd89dc9daee2b22b63dc950f..cf955cc51617c8f828f142c57dc9a3e2aa4cd686 100644 (file)
@@ -641,6 +641,12 @@ static int cgid_server(void *data)
         len = sizeof(unix_addr);
         sd2 = accept(sd, (struct sockaddr *)&unix_addr, &len);
         if (sd2 < 0) {
+#if defined(ENETDOWN)
+            if (errno == ENETDOWN) {
+                /* The network has been shut down, no need to continue. Die gracefully */
+               ++daemon_should_exit;
+           }
+#endif
             if (errno != EINTR) {
                 ap_log_error(APLOG_MARK, APLOG_ERR, errno, 
                              (server_rec *)data,