projects
/
guacd.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2e8bcaa
)
Ignore SIGPIPE (force checking of EPIPE instead).
author
Michael Jumper <zhangmaike@users.sourceforge.net>
Sat, 19 Mar 2011 23:50:18 +0000
(16:50 -0700)
committer
Michael Jumper <zhangmaike@users.sourceforge.net>
Sat, 19 Mar 2011 23:50:18 +0000
(16:50 -0700)
src/daemon.c
patch
|
blob
|
history
diff --git
a/src/daemon.c
b/src/daemon.c
index
4364eee
..
ef21908
100644
(file)
--- a/
src/daemon.c
+++ b/
src/daemon.c
@@
-39,6
+39,7
@@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <signal.h>
#include <sys/types.h>
#ifdef __MINGW32__
#include <sys/types.h>
#ifdef __MINGW32__
@@
-103,7
+104,6
@@
void* start_client_thread(void* data) {
}
guac_start_client(client);
}
guac_start_client(client);
-
guac_free_client(client);
/* Close socket */
guac_free_client(client);
/* Close socket */
@@
-235,6
+235,11
@@
int main(int argc, char* argv[]) {
/* Otherwise, this is the daemon */
GUAC_LOG_INFO("Started, listening on port %i", listen_port);
/* Otherwise, this is the daemon */
GUAC_LOG_INFO("Started, listening on port %i", listen_port);
+ /* Ignore SIGPIPE */
+ if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
+ GUAC_LOG_ERROR("Could not set handler for SIGPIPE to ignore. SIGPIPE will cause termination of the daemon.");
+ }
+
/* Daemon loop */
for (;;) {
/* Daemon loop */
for (;;) {