diff options
Diffstat (limited to 'src/util/child_management.c')
-rw-r--r-- | src/util/child_management.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/util/child_management.c b/src/util/child_management.c index 11fde4a61..3afd682b9 100644 --- a/src/util/child_management.c +++ b/src/util/child_management.c | |||
@@ -29,6 +29,11 @@ | |||
29 | #include "gnunet_util_lib.h" | 29 | #include "gnunet_util_lib.h" |
30 | #include "gnunet_child_management_lib.h" | 30 | #include "gnunet_child_management_lib.h" |
31 | 31 | ||
32 | /** | ||
33 | * Generic logging shortcut | ||
34 | */ | ||
35 | #define LOG(kind, ...) GNUNET_log (kind, __VA_ARGS__) | ||
36 | |||
32 | 37 | ||
33 | /** | 38 | /** |
34 | * Struct which defines a Child Wait handle | 39 | * Struct which defines a Child Wait handle |
@@ -87,7 +92,7 @@ maint_child_death (void *cls) | |||
87 | (void) cls; | 92 | (void) cls; |
88 | sig_task = NULL; | 93 | sig_task = NULL; |
89 | 94 | ||
90 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 95 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
91 | "Received SIGCHLD.\n"); | 96 | "Received SIGCHLD.\n"); |
92 | 97 | ||
93 | /* drain pipe */ | 98 | /* drain pipe */ |
@@ -193,6 +198,9 @@ GNUNET_wait_child (struct GNUNET_OS_Process *proc, | |||
193 | { | 198 | { |
194 | struct GNUNET_ChildWaitHandle *cwh; | 199 | struct GNUNET_ChildWaitHandle *cwh; |
195 | 200 | ||
201 | LOG (GNUNET_ERROR_TYPE_ERROR, | ||
202 | "Adding child!\n"); | ||
203 | |||
196 | child_management_start (); | 204 | child_management_start (); |
197 | cwh = GNUNET_new (struct GNUNET_ChildWaitHandle); | 205 | cwh = GNUNET_new (struct GNUNET_ChildWaitHandle); |
198 | cwh->proc = proc; | 206 | cwh->proc = proc; |
@@ -216,9 +224,12 @@ GNUNET_wait_child (struct GNUNET_OS_Process *proc, | |||
216 | void | 224 | void |
217 | GNUNET_wait_child_cancel (struct GNUNET_ChildWaitHandle *cwh) | 225 | GNUNET_wait_child_cancel (struct GNUNET_ChildWaitHandle *cwh) |
218 | { | 226 | { |
219 | GNUNET_CONTAINER_DLL_remove (cwh_head, | 227 | if ((NULL != cwh_head)) |
220 | cwh_tail, | 228 | { |
221 | cwh); | 229 | GNUNET_CONTAINER_DLL_remove (cwh_head, |
230 | cwh_tail, | ||
231 | cwh); | ||
232 | } | ||
222 | if (NULL == cwh_head) | 233 | if (NULL == cwh_head) |
223 | { | 234 | { |
224 | child_management_done (); | 235 | child_management_done (); |