aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server.c2
-rw-r--r--src/worker.c10
2 files changed, 9 insertions, 3 deletions
diff --git a/src/server.c b/src/server.c
index bf6a967..67f9e17 100644
--- a/src/server.c
+++ b/src/server.c
@@ -404,7 +404,7 @@ static int server_listen_thread(struct server *server)
ret = tcp_server_accept(server->tcp_server, cmd_dispatcher_handle_conn, dispatcher);
if (ret < 0) {
- if (errno == EINVAL && global_stop_flag)
+ if ((errno == EINTR || errno == EINVAL) && global_stop_flag)
ret = 0;
goto dispatcher_destroy;
}
diff --git a/src/worker.c b/src/worker.c
index 5762549..a316d7f 100644
--- a/src/worker.c
+++ b/src/worker.c
@@ -135,8 +135,11 @@ int worker_main(UNUSED struct worker *worker, const struct settings *settings)
log("Waiting for a new command\n");
ret = worker_send_new_worker(settings, &task);
- if (ret < 0)
+ if (ret < 0) {
+ if ((errno == EINTR || errno == EINVAL) && global_stop_flag)
+ ret = 0;
goto dispatcher_destroy;
+ }
while (!global_stop_flag) {
struct msg *result = NULL;
@@ -148,8 +151,11 @@ int worker_main(UNUSED struct worker *worker, const struct settings *settings)
ret = worker_send_to_server(settings, result, &task);
msg_free(result);
- if (ret < 0)
+ if (ret < 0) {
+ if ((errno == EINTR || errno == EINVAL) && global_stop_flag)
+ ret = 0;
goto dispatcher_destroy;
+ }
}
dispatcher_destroy: