aboutsummaryrefslogtreecommitdiff
path: root/src/util/signal.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-10-11 09:43:04 +0000
committerChristian Grothoff <christian@grothoff.org>2011-10-11 09:43:04 +0000
commitd9d94d0e53d26af75ec8241383d166544ebd79f3 (patch)
tree9080b73624389403a198257fe0547bb4634e64d2 /src/util/signal.c
parent2d792ee2e9cc0c993b8907e2c8edb0c2b8465343 (diff)
downloadgnunet-d9d94d0e53d26af75ec8241383d166544ebd79f3.tar.gz
gnunet-d9d94d0e53d26af75ec8241383d166544ebd79f3.zip
converting to GNUNET_LOG_from*
Diffstat (limited to 'src/util/signal.c')
-rw-r--r--src/util/signal.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/util/signal.c b/src/util/signal.c
index 395e8e517..a986b6260 100644
--- a/src/util/signal.c
+++ b/src/util/signal.c
@@ -28,6 +28,9 @@
28#include "gnunet_common.h" 28#include "gnunet_common.h"
29#include "gnunet_signal_lib.h" 29#include "gnunet_signal_lib.h"
30 30
31#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
32
33
31struct GNUNET_SIGNAL_Context 34struct GNUNET_SIGNAL_Context
32{ 35{
33 int sig; 36 int sig;
@@ -60,7 +63,7 @@ GNUNET_SIGNAL_handler_install (int signum, GNUNET_SIGNAL_Handler handler)
60 sig.sa_handler = (void *) handler; 63 sig.sa_handler = (void *) handler;
61 sigemptyset (&sig.sa_mask); 64 sigemptyset (&sig.sa_mask);
62#ifdef SA_INTERRUPT 65#ifdef SA_INTERRUPT
63 sig.sa_flags = SA_INTERRUPT; /* SunOS */ 66 sig.sa_flags = SA_INTERRUPT; /* SunOS */
64#else 67#else
65 sig.sa_flags = SA_RESTART; 68 sig.sa_flags = SA_RESTART;
66#endif 69#endif
@@ -69,15 +72,15 @@ GNUNET_SIGNAL_handler_install (int signum, GNUNET_SIGNAL_Handler handler)
69 if (signum == GNUNET_SIGCHLD) 72 if (signum == GNUNET_SIGCHLD)
70 w32_sigchld_handler = handler; 73 w32_sigchld_handler = handler;
71 else 74 else
72 {
73 __p_sig_fn_t sigret = signal (signum, (__p_sig_fn_t) handler);
74
75 if (sigret == SIG_ERR)
76 { 75 {
77 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 76 __p_sig_fn_t sigret = signal (signum, (__p_sig_fn_t) handler);
78 _("signal (%d, %p) returned %d.\n"), signum, handler, sigret); 77
78 if (sigret == SIG_ERR)
79 {
80 LOG (GNUNET_ERROR_TYPE_WARNING,
81 _("signal (%d, %p) returned %d.\n"), signum, handler, sigret);
82 }
79 } 83 }
80 }
81#endif 84#endif
82 return ret; 85 return ret;
83} 86}