diff options
author | David Härdeman <david@hardeman.nu> | 2020-06-10 23:17:20 +0200 |
---|---|---|
committer | David Härdeman <david@hardeman.nu> | 2020-06-10 23:17:20 +0200 |
commit | 1a3611151af25d4cf74ce1042cfe8b16fc85f3cb (patch) | |
tree | 7b157dfee200416908e877bd6f1fb0fb4e828a0e | |
parent | 32678c7d4e403c49158434d686ba8b8e450ee011 (diff) |
Add checks during server config reading to shutdown early
-rw-r--r-- | cfgdir.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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)); |