From ee4ec8009b68611b94ae11cff67980b05d355516 Mon Sep 17 00:00:00 2001 From: Martin Kraemer Date: Mon, 29 Oct 2007 17:38:11 +0000 Subject: [PATCH] After a stop or restart signal, the old listening sockets 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 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/os/unix/unixd.c b/os/unix/unixd.c index ae140093f4..8da536b513 100644 --- a/os/unix/unixd.c +++ b/os/unix/unixd.c @@ -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; -- 2.40.0