[PATCH 2/2] base/events: Don't shut down when attaching a debugger

robin.sonefors at op5.com robin.sonefors at op5.com
Mon Nov 12 15:33:40 CET 2012


From: Robin Sonefors <robin.sonefors at op5.com>

My patch in commit #2452 was incorrect, as it didn't ignore EINTR - we
should not shut down nagios due to EINTR, as that makes it awfully
complicated to discover what's going on.

Signed-off-by: Robin Sonefors <robin.sonefors at op5.com>
---
 base/events.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/base/events.c b/base/events.c
index cdaa188..5a1a5ea 100644
--- a/base/events.c
+++ b/base/events.c
@@ -1003,7 +1003,7 @@ int event_execution_loop(void) {
 		               poll_time_ms, iobroker_get_num_fds(nagios_iobs),
 		               squeue_size(nagios_squeue), nagios_iobs);
 		inputs = iobroker_poll(nagios_iobs, poll_time_ms);
-		if (inputs < 0) {
+		if (inputs < 0 && errno != EINTR) {
 			logit(NSLOG_RUNTIME_ERROR, TRUE, "Error polling for input, giving up");
 			break;
 		}
-- 
1.7.11.7


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_nov




More information about the Developers mailing list