projects
/
svn42.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
caa173d
)
ignore SIGPIPE and thus don't crash anymore
author
Bernhard Tittelbach
<xro@realraum.at>
Fri, 18 Jun 2010 20:42:43 +0000
(20:42 +0000)
committer
Bernhard Tittelbach
<xro@realraum.at>
Fri, 18 Jun 2010 20:42:43 +0000
(20:42 +0000)
powersensordaemon/sig_handler.c
patch
|
blob
|
history
diff --git
a/powersensordaemon/sig_handler.c
b/powersensordaemon/sig_handler.c
index
ca2e18f
..
03cc99f
100644
(file)
--- a/
powersensordaemon/sig_handler.c
+++ b/
powersensordaemon/sig_handler.c
@@
-92,7
+92,8
@@
int signal_init()
(sigaction(SIGTERM, &act, NULL) < 0) ||
(sigaction(SIGHUP, &act, NULL) < 0) ||
(sigaction(SIGUSR1, &act, NULL) < 0) ||
(sigaction(SIGTERM, &act, NULL) < 0) ||
(sigaction(SIGHUP, &act, NULL) < 0) ||
(sigaction(SIGUSR1, &act, NULL) < 0) ||
- (sigaction(SIGUSR2, &act, NULL) < 0)) {
+ (sigaction(SIGUSR2, &act, NULL) < 0) ||
+ (signal(SIGPIPE, SIG_IGN) == SIG_ERR)) {
log_printf(ERROR, "signal handling init failed (sigaction error: %s)", strerror(errno));
close(sig_pipe_fds[0]);
log_printf(ERROR, "signal handling init failed (sigaction error: %s)", strerror(errno));
close(sig_pipe_fds[0]);
@@
-153,6
+154,7
@@
void signal_stop()
sigaction(SIGHUP, &act, NULL);
sigaction(SIGUSR1, &act, NULL);
sigaction(SIGUSR2, &act, NULL);
sigaction(SIGHUP, &act, NULL);
sigaction(SIGUSR1, &act, NULL);
sigaction(SIGUSR2, &act, NULL);
+ signal(SIGPIPE, SIG_DFL);
close(sig_pipe_fds[0]);
close(sig_pipe_fds[1]);
close(sig_pipe_fds[0]);
close(sig_pipe_fds[1]);