From 1577a9adf61ea4f4f22e1986a2591984c7d68ae2 Mon Sep 17 00:00:00 2001 From: Martin Kraemer Date: Tue, 29 Jun 2004 13:48:20 +0000 Subject: [PATCH] Let CGI daemon die if the network layer has been shut down (problem noticed on BS2000/OSD) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104080 13f79535-47bb-0310-9956-ffa450edef68 --- modules/generators/mod_cgid.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/generators/mod_cgid.c b/modules/generators/mod_cgid.c index cb31f87d20..cf955cc516 100644 --- a/modules/generators/mod_cgid.c +++ b/modules/generators/mod_cgid.c @@ -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, -- 2.50.1