changeset 4550:592a720e8857 HEAD

Silently disable dnotify if kernel doesn't support RT signals, instead of just dying.
author Timo Sirainen <tss@iki.fi>
date Thu, 10 Aug 2006 18:54:24 +0300
parents 11e9f405d18e
children 2643a46322a6
files src/lib/ioloop-notify-dn.c
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib/ioloop-notify-dn.c	Mon Aug 07 18:01:54 2006 +0300
+++ b/src/lib/ioloop-notify-dn.c	Thu Aug 10 18:54:24 2006 +0300
@@ -161,8 +161,15 @@
 		sigemptyset(&act.sa_mask);
 		act.sa_flags = SA_SIGINFO | SA_RESTART | SA_NODEFER;
 
-		if (sigaction(SIGRTMIN, &act, NULL) < 0)
-			i_fatal("sigaction(SIGRTMIN) failed: %m");
+		if (sigaction(SIGRTMIN, &act, NULL) < 0) {
+			if (errno == EINVAL) {
+				/* kernel is too old to understand even RT
+				   signals, so there's no way dnotify works */
+				ctx->disabled = TRUE;
+			} else {
+				i_fatal("sigaction(SIGRTMIN) failed: %m");
+			}
+		}
 	}
 }