diff options
author | David Härdeman <david@hardeman.nu> | 2020-06-09 14:04:09 +0200 |
---|---|---|
committer | David Härdeman <david@hardeman.nu> | 2020-06-09 14:04:09 +0200 |
commit | dde820746850b4abe18503e7c6f38d6532a407ce (patch) | |
tree | c0ef754168ff285621b91db73f2b4d061dc193a4 | |
parent | 7c20ae7f7737c35a9e322ee712a0c342d00f536e (diff) |
Some minor cleanups
-rw-r--r-- | cfgdir.c | 4 | ||||
-rw-r--r-- | server.c | 6 |
2 files changed, 5 insertions, 5 deletions
@@ -235,9 +235,7 @@ scfg_valid_filename(const char *name) { const char *suffix; - if (!name) - return false; - if (name[0] == '\0') + if (empty_str(name)) return false; if (name[0] == '.') return false; @@ -93,7 +93,7 @@ server_delete_by_name(struct cfg *cfg, const char *name) { struct server *scfg; - if (!cfg || !name || name[0] == '\0') + if (!cfg || empty_str(name)) return; list_for_each_entry(scfg, &cfg->servers, list) { @@ -247,7 +247,9 @@ exec_cmd(struct cfg *cfg, struct server *scfg, const char *cmd) } } while (!WIFEXITED(wstatus)); - fprintf(stderr, "Child %s exited: %i\n", scfg->start_exec, WEXITSTATUS(wstatus)); + fprintf(stderr, "Child %s exited: %i\n", scfg->start_exec, + WEXITSTATUS(wstatus)); + if (WEXITSTATUS(wstatus) == 0) return true; else |