summaryrefslogtreecommitdiff
path: root/src/socket.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-07-13 00:27:27 +0200
committerLennart Poettering <lennart@poettering.net>2010-07-13 00:27:27 +0200
commitba3e67a78564bf25c5af97ffe2e1a122b193a9cb (patch)
tree8d47f6a421da2660ac090dd526c387b5fc90e744 /src/socket.c
parenta974d58e83e409a92ca916bb9bbce0e457ea896f (diff)
socket: when the socket is supposed to stop, don't accept any connections anymore
Diffstat (limited to 'src/socket.c')
-rw-r--r--src/socket.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/socket.c b/src/socket.c
index 2d113aef30..f998cada26 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -1030,6 +1030,13 @@ static void socket_enter_running(Socket *s, int cfd) {
assert(s);
dbus_error_init(&error);
+ /* We don't take connections anymore if we are supposed to
+ * shut down anyway */
+ if (s->meta.job && s->meta.job->type == JOB_STOP) {
+ close_nointr_nofail(cfd);
+ return;
+ }
+
if (cfd < 0) {
if ((r = manager_add_job(s->meta.manager, JOB_START, UNIT(s->service), JOB_REPLACE, true, &error, NULL)) < 0)
goto fail;