summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cfgdir.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/cfgdir.c b/cfgdir.c
index 9ffff3e..08b40f1 100644
--- a/cfgdir.c
+++ b/cfgdir.c
@@ -226,7 +226,10 @@ scfg_read_cb(struct cfg *cfg, struct uring_task *task, int res)
{
struct server *scfg = container_of(task, struct server, task);
- if (res < 0) {
+ if (task->dead)
+ return;
+
+ if (res <= 0) {
fprintf(stderr, "%s: error reading config file for %s: %s\n",
__func__, scfg->name, strerror(-res));
server_delete(cfg, scfg);
@@ -243,6 +246,9 @@ scfg_open_cb(struct cfg *cfg, struct uring_task *task, int res)
{
struct server *scfg = container_of(task, struct server, task);
+ if (task->dead)
+ return;
+
if (res < 0) {
fprintf(stderr, "%s: open(%s) failed: %s\n",
__func__, scfg->name, strerror(-res));