diff options
author | grothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96> | 2011-10-11 09:43:04 +0000 |
---|---|---|
committer | grothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96> | 2011-10-11 09:43:04 +0000 |
commit | 6d98f6f678af40a5893a511bce254c39f8abc78b (patch) | |
tree | 9080b73624389403a198257fe0547bb4634e64d2 /src/util/signal.c | |
parent | 99712a58d5a649363998f2355302df7dcc247d29 (diff) |
converting to GNUNET_LOG_from*
git-svn-id: https://gnunet.org/svn/gnunet@17362 140774ce-b5e7-0310-ab8b-a85725594a96
Diffstat (limited to 'src/util/signal.c')
-rw-r--r-- | src/util/signal.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/util/signal.c b/src/util/signal.c index 395e8e5176..a986b62605 100644 --- a/src/util/signal.c +++ b/src/util/signal.c @@ -28,6 +28,9 @@ #include "gnunet_common.h" #include "gnunet_signal_lib.h" +#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) + + struct GNUNET_SIGNAL_Context { int sig; @@ -60,7 +63,7 @@ GNUNET_SIGNAL_handler_install (int signum, GNUNET_SIGNAL_Handler handler) sig.sa_handler = (void *) handler; sigemptyset (&sig.sa_mask); #ifdef SA_INTERRUPT - sig.sa_flags = SA_INTERRUPT; /* SunOS */ + sig.sa_flags = SA_INTERRUPT; /* SunOS */ #else sig.sa_flags = SA_RESTART; #endif @@ -69,15 +72,15 @@ GNUNET_SIGNAL_handler_install (int signum, GNUNET_SIGNAL_Handler handler) if (signum == GNUNET_SIGCHLD) w32_sigchld_handler = handler; else - { - __p_sig_fn_t sigret = signal (signum, (__p_sig_fn_t) handler); - - if (sigret == SIG_ERR) { - GNUNET_log (GNUNET_ERROR_TYPE_WARNING, - _("signal (%d, %p) returned %d.\n"), signum, handler, sigret); + __p_sig_fn_t sigret = signal (signum, (__p_sig_fn_t) handler); + + if (sigret == SIG_ERR) + { + LOG (GNUNET_ERROR_TYPE_WARNING, + _("signal (%d, %p) returned %d.\n"), signum, handler, sigret); + } } - } #endif return ret; } |