dovecot-1.2: lib-signals: Set signal pipe fds non-blocking to ma...
dovecot at dovecot.org
dovecot at dovecot.org
Wed Dec 16 00:28:38 EET 2009
details: http://hg.dovecot.org/dovecot-1.2/rev/9c99f15829fa
changeset: 9508:9c99f15829fa
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 9af9343084d4 -r 9c99f15829fa src/lib/lib-signals.c
--- a/src/lib/lib-signals.c Tue Dec 15 14:05:06 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