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.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/testbed/gnunet-helper-testbed.c b/src/testbed/gnunet-helper-testbed.c
index 6937d7262..ccb868e8b 100644
--- a/src/testbed/gnunet-helper-testbed.c
+++ b/src/testbed/gnunet-helper-testbed.c
@@ -124,22 +124,22 @@ static struct GNUNET_DISK_PipeHandle *sigpipe;
124/** 124/**
125 * Task identifier for the read task 125 * Task identifier for the read task
126 */ 126 */
127static GNUNET_SCHEDULER_TaskIdentifier read_task_id; 127static struct GNUNET_SCHEDULER_Task * read_task_id;
128 128
129/** 129/**
130 * Task identifier for the write task 130 * Task identifier for the write task
131 */ 131 */
132static GNUNET_SCHEDULER_TaskIdentifier write_task_id; 132static struct GNUNET_SCHEDULER_Task * write_task_id;
133 133
134/** 134/**
135 * Task to kill the child 135 * Task to kill the child
136 */ 136 */
137static GNUNET_SCHEDULER_TaskIdentifier child_death_task_id; 137static struct GNUNET_SCHEDULER_Task * child_death_task_id;
138 138
139/** 139/**
140 * shutdown task id 140 * shutdown task id
141 */ 141 */
142static GNUNET_SCHEDULER_TaskIdentifier shutdown_task_id; 142static struct GNUNET_SCHEDULER_Task * shutdown_task_id;
143 143
144/** 144/**
145 * Are we done reading messages from stdin? 145 * Are we done reading messages from stdin?
@@ -162,26 +162,26 @@ static void
162shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 162shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
163{ 163{
164 LOG_DEBUG ("Shutting down\n"); 164 LOG_DEBUG ("Shutting down\n");
165 shutdown_task_id = GNUNET_SCHEDULER_NO_TASK; 165 shutdown_task_id = NULL;
166 if (NULL != testbed) 166 if (NULL != testbed)
167 { 167 {
168 LOG_DEBUG ("Killing testbed\n"); 168 LOG_DEBUG ("Killing testbed\n");
169 GNUNET_break (0 == GNUNET_OS_process_kill (testbed, GNUNET_TERM_SIG)); 169 GNUNET_break (0 == GNUNET_OS_process_kill (testbed, GNUNET_TERM_SIG));
170 } 170 }
171 if (GNUNET_SCHEDULER_NO_TASK != read_task_id) 171 if (NULL != read_task_id)
172 { 172 {
173 GNUNET_SCHEDULER_cancel (read_task_id); 173 GNUNET_SCHEDULER_cancel (read_task_id);
174 read_task_id = GNUNET_SCHEDULER_NO_TASK; 174 read_task_id = NULL;
175 } 175 }
176 if (GNUNET_SCHEDULER_NO_TASK != write_task_id) 176 if (NULL != write_task_id)
177 { 177 {
178 GNUNET_SCHEDULER_cancel (write_task_id); 178 GNUNET_SCHEDULER_cancel (write_task_id);
179 write_task_id = GNUNET_SCHEDULER_NO_TASK; 179 write_task_id = NULL;
180 } 180 }
181 if (GNUNET_SCHEDULER_NO_TASK != child_death_task_id) 181 if (NULL != child_death_task_id)
182 { 182 {
183 GNUNET_SCHEDULER_cancel (child_death_task_id); 183 GNUNET_SCHEDULER_cancel (child_death_task_id);
184 child_death_task_id = GNUNET_SCHEDULER_NO_TASK; 184 child_death_task_id = NULL;
185 } 185 }
186 if (NULL != stdin_fd) 186 if (NULL != stdin_fd)
187 (void) GNUNET_DISK_file_close (stdin_fd); 187 (void) GNUNET_DISK_file_close (stdin_fd);
@@ -209,7 +209,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
209static void 209static void
210shutdown_now (void) 210shutdown_now (void)
211{ 211{
212 if (GNUNET_SCHEDULER_NO_TASK != shutdown_task_id) 212 if (NULL != shutdown_task_id)
213 GNUNET_SCHEDULER_cancel (shutdown_task_id); 213 GNUNET_SCHEDULER_cancel (shutdown_task_id);
214 shutdown_task_id = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL); 214 shutdown_task_id = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
215} 215}
@@ -228,7 +228,7 @@ write_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
228 ssize_t bytes_wrote; 228 ssize_t bytes_wrote;
229 229
230 GNUNET_assert (NULL != wc); 230 GNUNET_assert (NULL != wc);
231 write_task_id = GNUNET_SCHEDULER_NO_TASK; 231 write_task_id = NULL;
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);
@@ -275,7 +275,7 @@ child_death_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
275 int ret; 275 int ret;
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 = GNUNET_SCHEDULER_NO_TASK; 278 child_death_task_id = NULL;
279 if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY)) 279 if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY))
280 { 280 {
281 child_death_task_id = 281 child_death_task_id =
@@ -518,7 +518,7 @@ read_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
518 char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE]; 518 char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE];
519 ssize_t sread; 519 ssize_t sread;
520 520
521 read_task_id = GNUNET_SCHEDULER_NO_TASK; 521 read_task_id = NULL;
522 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) 522 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
523 return; 523 return;
524 sread = GNUNET_DISK_file_read (stdin_fd, buf, sizeof (buf)); 524 sread = GNUNET_DISK_file_read (stdin_fd, buf, sizeof (buf));