aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2013-10-12 00:07:33 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2013-10-12 00:07:33 +0000
commit27728a48d661e9ee546cc95aae8fa52050eefb29 (patch)
tree89450fc22b530dc592134ac18405180eeafe13b3 /src/util
parent6d38e5b12b460d1d7f0a6eafe1410f7121e04002 (diff)
downloadgnunet-27728a48d661e9ee546cc95aae8fa52050eefb29.tar.gz
gnunet-27728a48d661e9ee546cc95aae8fa52050eefb29.zip
- change --enable-ll to --enable-supermuc
- define a system wide termination signal GNUNET_TERM_SIG. Set this to SIGUSR1 only when building for SuperMUC
Diffstat (limited to 'src/util')
-rw-r--r--src/util/gnunet-uri.c2
-rw-r--r--src/util/helper.c2
-rw-r--r--src/util/os_priority.c3
-rw-r--r--src/util/scheduler.c9
-rw-r--r--src/util/test_common_logging_runtime_loglevels.c2
-rw-r--r--src/util/test_os_start_process.c6
-rw-r--r--src/util/test_resolver_api.c2
-rw-r--r--src/util/test_scheduler.c2
8 files changed, 20 insertions, 8 deletions
diff --git a/src/util/gnunet-uri.c b/src/util/gnunet-uri.c
index 1964aade4..3465b5906 100644
--- a/src/util/gnunet-uri.c
+++ b/src/util/gnunet-uri.c
@@ -62,7 +62,7 @@ maint_child_death (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
62 (0 == code) ) 62 (0 == code) )
63 ret = 0; 63 ret = 0;
64 else 64 else
65 GNUNET_break (0 == GNUNET_OS_process_kill (p, SIGTERM)); 65 GNUNET_break (0 == GNUNET_OS_process_kill (p, GNUNET_TERM_SIG));
66 GNUNET_OS_process_destroy (p); 66 GNUNET_OS_process_destroy (p);
67} 67}
68 68
diff --git a/src/util/helper.c b/src/util/helper.c
index 21f196ebc..404dad4fa 100644
--- a/src/util/helper.c
+++ b/src/util/helper.c
@@ -208,7 +208,7 @@ GNUNET_HELPER_kill (struct GNUNET_HELPER_Handle *h,
208 h->fh_to_helper = NULL; 208 h->fh_to_helper = NULL;
209 return ret; 209 return ret;
210 } 210 }
211 if (0 != GNUNET_OS_process_kill (h->helper_proc, SIGTERM)) 211 if (0 != GNUNET_OS_process_kill (h->helper_proc, GNUNET_TERM_SIG))
212 return GNUNET_SYSERR; 212 return GNUNET_SYSERR;
213 return GNUNET_OK; 213 return GNUNET_OK;
214} 214}
diff --git a/src/util/os_priority.c b/src/util/os_priority.c
index d499ed985..1466ce059 100644
--- a/src/util/os_priority.c
+++ b/src/util/os_priority.c
@@ -229,6 +229,9 @@ GNUNET_OS_process_kill (struct GNUNET_OS_Process *proc, int sig)
229 case SIGINT: 229 case SIGINT:
230 case SIGKILL: 230 case SIGKILL:
231 case SIGTERM: 231 case SIGTERM:
232#if (SIGTERM != GNUNET_TERM_SIG)
233 case GNUNET_TERM_SIG:
234#endif
232#if defined(WINDOWS) && !defined(__CYGWIN__) 235#if defined(WINDOWS) && !defined(__CYGWIN__)
233 { 236 {
234 DWORD exitcode; 237 DWORD exitcode;
diff --git a/src/util/scheduler.c b/src/util/scheduler.c
index 8652ee297..36c3a443b 100644
--- a/src/util/scheduler.c
+++ b/src/util/scheduler.c
@@ -717,6 +717,9 @@ GNUNET_SCHEDULER_run (GNUNET_SCHEDULER_Task task, void *task_cls)
717 int ret; 717 int ret;
718 struct GNUNET_SIGNAL_Context *shc_int; 718 struct GNUNET_SIGNAL_Context *shc_int;
719 struct GNUNET_SIGNAL_Context *shc_term; 719 struct GNUNET_SIGNAL_Context *shc_term;
720#if (SIGTERM != GNUNET_TERM_SIG)
721 struct GNUNET_SIGNAL_Context *shc_gterm;
722#endif
720 723
721#ifndef MINGW 724#ifndef MINGW
722 struct GNUNET_SIGNAL_Context *shc_quit; 725 struct GNUNET_SIGNAL_Context *shc_quit;
@@ -741,6 +744,9 @@ GNUNET_SCHEDULER_run (GNUNET_SCHEDULER_Task task, void *task_cls)
741 LOG (GNUNET_ERROR_TYPE_DEBUG, "Registering signal handlers\n"); 744 LOG (GNUNET_ERROR_TYPE_DEBUG, "Registering signal handlers\n");
742 shc_int = GNUNET_SIGNAL_handler_install (SIGINT, &sighandler_shutdown); 745 shc_int = GNUNET_SIGNAL_handler_install (SIGINT, &sighandler_shutdown);
743 shc_term = GNUNET_SIGNAL_handler_install (SIGTERM, &sighandler_shutdown); 746 shc_term = GNUNET_SIGNAL_handler_install (SIGTERM, &sighandler_shutdown);
747#if (SIGTERM != GNUNET_TERM_SIG)
748 shc_gterm = GNUNET_SIGNAL_handler_install (GNUNET_TERM_SIG, &sighandler_shutdown);
749#endif
744#ifndef MINGW 750#ifndef MINGW
745 shc_pipe = GNUNET_SIGNAL_handler_install (SIGPIPE, &sighandler_pipe); 751 shc_pipe = GNUNET_SIGNAL_handler_install (SIGPIPE, &sighandler_pipe);
746 shc_quit = GNUNET_SIGNAL_handler_install (SIGQUIT, &sighandler_shutdown); 752 shc_quit = GNUNET_SIGNAL_handler_install (SIGQUIT, &sighandler_shutdown);
@@ -820,6 +826,9 @@ GNUNET_SCHEDULER_run (GNUNET_SCHEDULER_Task task, void *task_cls)
820 } 826 }
821 GNUNET_SIGNAL_handler_uninstall (shc_int); 827 GNUNET_SIGNAL_handler_uninstall (shc_int);
822 GNUNET_SIGNAL_handler_uninstall (shc_term); 828 GNUNET_SIGNAL_handler_uninstall (shc_term);
829#if (SIGTERM != GNUNET_TERM_SIG)
830 GNUNET_SIGNAL_handler_install (shc_gterm);
831#endif
823#ifndef MINGW 832#ifndef MINGW
824 GNUNET_SIGNAL_handler_uninstall (shc_pipe); 833 GNUNET_SIGNAL_handler_uninstall (shc_pipe);
825 GNUNET_SIGNAL_handler_uninstall (shc_quit); 834 GNUNET_SIGNAL_handler_uninstall (shc_quit);
diff --git a/src/util/test_common_logging_runtime_loglevels.c b/src/util/test_common_logging_runtime_loglevels.c
index 7d8834082..14055e11f 100644
--- a/src/util/test_common_logging_runtime_loglevels.c
+++ b/src/util/test_common_logging_runtime_loglevels.c
@@ -64,7 +64,7 @@ end_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
64 ok); 64 ok);
65 if (NULL != proc) 65 if (NULL != proc)
66 { 66 {
67 if (0 != GNUNET_OS_process_kill (proc, SIGTERM)) 67 if (0 != GNUNET_OS_process_kill (proc, GNUNET_TERM_SIG))
68 { 68 {
69 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); 69 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
70 } 70 }
diff --git a/src/util/test_os_start_process.c b/src/util/test_os_start_process.c
index 8e701750b..90d8ae101 100644
--- a/src/util/test_os_start_process.c
+++ b/src/util/test_os_start_process.c
@@ -60,7 +60,7 @@ struct read_context rc;
60static void 60static void
61end_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 61end_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
62{ 62{
63 if (0 != GNUNET_OS_process_kill (proc, SIGTERM)) 63 if (0 != GNUNET_OS_process_kill (proc, GNUNET_TERM_SIG))
64 { 64 {
65 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); 65 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
66 } 66 }
@@ -207,7 +207,7 @@ check_kill ()
207 "gnunet-service-resolver", "-", NULL); 207 "gnunet-service-resolver", "-", NULL);
208 sleep (1); /* give process time to start, so we actually use the pipe-kill mechanism! */ 208 sleep (1); /* give process time to start, so we actually use the pipe-kill mechanism! */
209 GNUNET_free (fn); 209 GNUNET_free (fn);
210 if (0 != GNUNET_OS_process_kill (proc, SIGTERM)) 210 if (0 != GNUNET_OS_process_kill (proc, GNUNET_TERM_SIG))
211 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); 211 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
212 GNUNET_assert (GNUNET_OK == GNUNET_OS_process_wait (proc)); 212 GNUNET_assert (GNUNET_OK == GNUNET_OS_process_wait (proc));
213 GNUNET_OS_process_destroy (proc); 213 GNUNET_OS_process_destroy (proc);
@@ -236,7 +236,7 @@ check_instant_kill ()
236 proc = 236 proc =
237 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_ERR, hello_pipe_stdin, hello_pipe_stdout, fn, 237 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_ERR, hello_pipe_stdin, hello_pipe_stdout, fn,
238 "gnunet-service-resolver", "-", NULL); 238 "gnunet-service-resolver", "-", NULL);
239 if (0 != GNUNET_OS_process_kill (proc, SIGTERM)) 239 if (0 != GNUNET_OS_process_kill (proc, GNUNET_TERM_SIG))
240 { 240 {
241 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); 241 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
242 } 242 }
diff --git a/src/util/test_resolver_api.c b/src/util/test_resolver_api.c
index bcbaf4f04..220f4bdac 100644
--- a/src/util/test_resolver_api.c
+++ b/src/util/test_resolver_api.c
@@ -374,7 +374,7 @@ main (int argc, char *argv[])
374 GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1, 374 GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1,
375 argvx, "test-resolver-api", "nohelp", 375 argvx, "test-resolver-api", "nohelp",
376 options, &run, &ok)); 376 options, &run, &ok));
377 if (0 != GNUNET_OS_process_kill (proc, SIGTERM)) 377 if (0 != GNUNET_OS_process_kill (proc, GNUNET_TERM_SIG))
378 { 378 {
379 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); 379 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
380 ok = 1; 380 ok = 1;
diff --git a/src/util/test_scheduler.c b/src/util/test_scheduler.c
index 70ff95550..4cfd81c81 100644
--- a/src/util/test_scheduler.c
+++ b/src/util/test_scheduler.c
@@ -183,7 +183,7 @@ taskSig (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
183 GNUNET_assert (1 == *ok); 183 GNUNET_assert (1 == *ok);
184 *ok = 8; 184 *ok = 8;
185 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &taskLast, cls); 185 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &taskLast, cls);
186 GNUNET_break (0 == PLIBC_KILL (getpid (), SIGTERM)); 186 GNUNET_break (0 == PLIBC_KILL (getpid (), GNUNET_TERM_SIG));
187} 187}
188 188
189 189