diff options
-rw-r--r-- | server.c | 18 |
1 files changed, 6 insertions, 12 deletions
@@ -382,8 +382,7 @@ server_start(struct cfg *cfg, struct server *server) if (!cfg || !server) return false; - if (server->task.dead) - return false; + assert_task_alive_or(DBG_SRV, &server->task, return false); switch (server->start_method) { @@ -415,8 +414,7 @@ server_stop(struct cfg *cfg, struct server *server) if (!cfg || !server) return false; - if (server->task.dead) - return false; + assert_task_alive_or(DBG_SRV, &server->task, return false); switch (server->stop_method) { @@ -457,8 +455,7 @@ server_commit(struct cfg *cfg, struct server *server) return false; } - if (server->task.dead) - return false; + assert_task_alive_or(DBG_SRV, &server->task, return false); if (server->state != SERVER_STATE_INIT) { error("called in wrong state"); @@ -620,8 +617,7 @@ server_add_remote(struct cfg *cfg, struct server *server, struct saddr *remote) if (!server || !remote) return false; - if (server->task.dead) - return false; + assert_task_alive_or(DBG_SRV, &server->task, return false); debug(DBG_SRV, "adding remote: %s", remote->addrstr); list_add(&remote->list, &server->remotes); @@ -638,8 +634,7 @@ server_add_local(struct cfg *cfg, struct server *server, struct saddr *saddr) return false; } - if (server->task.dead) - return false; + assert_task_alive_or(DBG_SRV, &server->task, return false); local = zmalloc(sizeof(*local)); if (!local) { @@ -662,8 +657,7 @@ server_add_rcon(struct cfg *cfg, struct server *server, struct saddr *rcon) if (!server || !rcon) return false; - if (server->task.dead) - return false; + assert_task_alive_or(DBG_SRV, &server->task, return false); debug(DBG_SRV, "adding rcon: %s", rcon->addrstr); list_add(&rcon->list, &server->rcons); |