]> granicus.if.org Git - apache/commitdiff
After a stop or restart signal, the old listening sockets
authorMartin Kraemer <martin@apache.org>
Mon, 29 Oct 2007 17:38:11 +0000 (17:38 +0000)
committerMartin Kraemer <martin@apache.org>
Mon, 29 Oct 2007 17:38:11 +0000 (17:38 +0000)
are closed. "Some platforms" drop out of the accept() with
an EBADF after the sockets have been closed. Such an
error should not clutter the logs.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@589761 13f79535-47bb-0310-9956-ffa450edef68

os/unix/unixd.c

index ae140093f4d67f5174046cced1e631f20506e6fa..8da536b5131b0345ccab8be1d489a3964520c605 100644 (file)
@@ -593,6 +593,14 @@ AP_DECLARE(apr_status_t) unixd_accept(void **accepted, ap_listen_rec *lr,
             return APR_EGENERAL;
 #else
         default:
+#ifdef _OSD_POSIX /* Possibly on other platforms too */
+            /* If the socket has been closed in ap_close_listeners()
+             * by the restart/stop action, we may get EBADF.
+             * Do not print an error in this case.
+             */
+            if (!lr->active && status == EBADF)
+                return status;
+#endif
             ap_log_error(APLOG_MARK, APLOG_ERR, status, ap_server_conf,
                          "apr_socket_accept: (client socket)");
             return APR_EGENERAL;