comparison sciworkerd/sciworkerd.c @ 34:e52c762d8ba8

misc: cleanups
author David Demelier <markand@malikania.fr>
date Thu, 04 Aug 2022 17:47:19 +0200
parents dae2de19ca5d
children 4076b07c7a6f
comparison
equal deleted inserted replaced
33:1d0ddf9e6efd 34:e52c762d8ba8
1 /*
2 * sciworkerd.c -- main sciworkerd file
3 *
4 * Copyright (c) 2021-2022 David Demelier <markand@malikania.fr>
5 *
6 * Permission to use, copy, modify, and/or distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18
1 #include <errno.h> 19 #include <errno.h>
2 #include <poll.h> 20 #include <poll.h>
3 #include <signal.h> 21 #include <signal.h>
4 #include <stdint.h> 22 #include <stdint.h>
5 #include <string.h> 23 #include <string.h>
373 { 391 {
374 struct taskentry *iter, *tmp; 392 struct taskentry *iter, *tmp;
375 393
376 LL_FOREACH_SAFE(taskpending, iter, tmp) 394 LL_FOREACH_SAFE(taskpending, iter, tmp)
377 taskentry_free(iter); 395 taskentry_free(iter);
378 LL_FOREACH_SAFE(tasks, iter, tmp) 396 LL_FOREACH_SAFE(tasks, iter, tmp) {
397 task_kill(iter->task);
379 taskentry_free(iter); 398 taskentry_free(iter);
399 }
380 LL_FOREACH_SAFE(taskfinished, iter, tmp) 400 LL_FOREACH_SAFE(taskfinished, iter, tmp)
381 taskentry_free(iter); 401 taskentry_free(iter);
382 } 402 }