dovecot-2.0: lib-signals: Set signal pipe fds non-blocking to ma...

dovecot at dovecot.org dovecot at dovecot.org
Wed Dec 16 00:28:23 EET 2009


details:   http://hg.dovecot.org/dovecot-2.0/rev/2d7e2e76a100
changeset: 10493:2d7e2e76a100
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Dec 15 17:28:16 2009 -0500
description:
lib-signals: Set signal pipe fds non-blocking to make sure read/write doesn't hang.

diffstat:

1 file changed, 3 insertions(+)
src/lib/lib-signals.c |    3 +++

diffs (20 lines):

diff -r eabe311c8649 -r 2d7e2e76a100 src/lib/lib-signals.c
--- a/src/lib/lib-signals.c	Tue Dec 15 14:06:18 2009 -0500
+++ b/src/lib/lib-signals.c	Tue Dec 15 17:28:16 2009 -0500
@@ -3,6 +3,7 @@
 #include "lib.h"
 #include "ioloop.h"
 #include "fd-close-on-exec.h"
+#include "fd-set-nonblock.h"
 #include "lib-signals.h"
 
 #include <signal.h>
@@ -197,6 +198,8 @@ void lib_signals_set_handler(int signo, 
 		/* first delayed handler */
 		if (pipe(sig_pipe_fd) < 0)
 			i_fatal("pipe() failed: %m");
+		fd_set_nonblock(sig_pipe_fd[0], TRUE);
+		fd_set_nonblock(sig_pipe_fd[1], TRUE);
 		fd_close_on_exec(sig_pipe_fd[0], TRUE);
 		fd_close_on_exec(sig_pipe_fd[1], TRUE);
 		if (signals_initialized) {


More information about the dovecot-cvs mailing list