diff --git a/checkin_notes b/checkin_notes index 064473fa27..17e05053a0 100755 --- a/checkin_notes +++ b/checkin_notes @@ -13354,3 +13354,12 @@ Rom 24 Oct 2005 main.C lib/ diagnostics.C + +Charlie 25 Oct 2005 + - Mac: Work around a bug which caused the core client to block + after receipt of SIGTERM, SIGHUP, SIGINT or SIGQUIT, preventing + the main loop from processing the exit request. + + client/ + gui_rpc_server.C + \ No newline at end of file diff --git a/client/gui_rpc_server.C b/client/gui_rpc_server.C index 9d74fbab5f..98c787b218 100644 --- a/client/gui_rpc_server.C +++ b/client/gui_rpc_server.C @@ -248,6 +248,17 @@ void GUI_RPC_CONN_SET::got_select(FDSET_GROUP& fg) { if (FD_ISSET(lsock, &fg.read_fds)) { struct sockaddr_in addr; +#ifdef __APPLE__ + // For unknown reasons, the FD_ISSET() above succeeds on the + // Macintosh after a SIGTERM, SIGHUP, SIGINT or SIGQUIT is + // received, even if there is no data available on the socket. + // This causes the accept() call to block, preventing the main + // loop from processing the exit request. This is a workaround + // for that problem. + if (gstate.requested_exit) + return; +#endif + boinc_socklen_t addr_len = sizeof(addr); sock = accept(lsock, (struct sockaddr*)&addr, &addr_len);