aboutsummaryrefslogtreecommitdiff
path: root/src/testbed/gnunet-helper-testbed.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testbed/gnunet-helper-testbed.c')
-rw-r--r--src/testbed/gnunet-helper-testbed.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/testbed/gnunet-helper-testbed.c b/src/testbed/gnunet-helper-testbed.c
index 4cde1b4d0..b43f10983 100644
--- a/src/testbed/gnunet-helper-testbed.c
+++ b/src/testbed/gnunet-helper-testbed.c
@@ -156,10 +156,9 @@ static int status;
156 * Task to shut down cleanly 156 * Task to shut down cleanly
157 * 157 *
158 * @param cls NULL 158 * @param cls NULL
159 * @param tc the task context
160 */ 159 */
161static void 160static void
162shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 161shutdown_task (void *cls)
163{ 162{
164 LOG_DEBUG ("Shutting down\n"); 163 LOG_DEBUG ("Shutting down\n");
165 shutdown_task_id = NULL; 164 shutdown_task_id = NULL;
@@ -219,16 +218,17 @@ shutdown_now (void)
219 * Task to write to the standard out 218 * Task to write to the standard out
220 * 219 *
221 * @param cls the WriteContext 220 * @param cls the WriteContext
222 * @param tc the TaskContext
223 */ 221 */
224static void 222static void
225write_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 223write_task (void *cls)
226{ 224{
227 struct WriteContext *wc = cls; 225 struct WriteContext *wc = cls;
228 ssize_t bytes_wrote; 226 ssize_t bytes_wrote;
227 const struct GNUNET_SCHEDULER_TaskContext *tc;
229 228
230 GNUNET_assert (NULL != wc); 229 GNUNET_assert (NULL != wc);
231 write_task_id = NULL; 230 write_task_id = NULL;
231 tc = GNUNET_SCHEDULER_get_task_context ();
232 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) 232 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
233 { 233 {
234 GNUNET_free (wc->data); 234 GNUNET_free (wc->data);
@@ -263,19 +263,20 @@ write_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
263 * process died). 263 * process died).
264 * 264 *
265 * @param cls closure, NULL if we need to self-restart 265 * @param cls closure, NULL if we need to self-restart
266 * @param tc context
267 */ 266 */
268static void 267static void
269child_death_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 268child_death_task (void *cls)
270{ 269{
271 const struct GNUNET_DISK_FileHandle *pr; 270 const struct GNUNET_DISK_FileHandle *pr;
272 char c[16]; 271 char c[16];
273 enum GNUNET_OS_ProcessStatusType type; 272 enum GNUNET_OS_ProcessStatusType type;
274 unsigned long code; 273 unsigned long code;
275 int ret; 274 int ret;
275 const struct GNUNET_SCHEDULER_TaskContext *tc;
276 276
277 pr = GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ); 277 pr = GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ);
278 child_death_task_id = NULL; 278 child_death_task_id = NULL;
279 tc = GNUNET_SCHEDULER_get_task_context ();
279 if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY)) 280 if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY))
280 { 281 {
281 child_death_task_id = 282 child_death_task_id =
@@ -518,15 +519,16 @@ error:
518 * Task to read from stdin 519 * Task to read from stdin
519 * 520 *
520 * @param cls NULL 521 * @param cls NULL
521 * @param tc the task context
522 */ 522 */
523static void 523static void
524read_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 524read_task (void *cls)
525{ 525{
526 char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE]; 526 char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE];
527 ssize_t sread; 527 ssize_t sread;
528 const struct GNUNET_SCHEDULER_TaskContext *tc;
528 529
529 read_task_id = NULL; 530 read_task_id = NULL;
531 tc = GNUNET_SCHEDULER_get_task_context ();
530 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) 532 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
531 return; 533 return;
532 sread = GNUNET_DISK_file_read (stdin_fd, buf, sizeof (buf)); 534 sread = GNUNET_DISK_file_read (stdin_fd, buf, sizeof (buf));