diff options
author | Lennart Poettering <lennart@poettering.net> | 2012-09-17 14:55:56 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-09-17 14:56:44 +0200 |
commit | bfba3256a02a0871579c4ee48d787dfe4585fd8d (patch) | |
tree | ba5ca800d0eab899f30885e294bc44e13686e6c6 /src | |
parent | de34a42bcad31f0648ac0f249801310e0dbf83f9 (diff) |
service: don't hit an assert if a service unit changes type and we get a spurious event from before
Diffstat (limited to 'src')
-rw-r--r-- | src/core/service.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/service.c b/src/core/service.c index 807b34267f..7b5ff6d1ac 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -2961,12 +2961,10 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) { else service_enter_signal(s, SERVICE_FINAL_SIGTERM, f); break; - } else { - assert(s->type == SERVICE_DBUS || s->type == SERVICE_NOTIFY); - - /* Fall through */ } + /* Fall through */ + case SERVICE_RUNNING: service_enter_running(s, f); break; @@ -3036,7 +3034,9 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) { break; case SERVICE_START: - assert(s->type == SERVICE_FORKING); + if (s->type != SERVICE_FORKING) + /* Maybe spurious event due to a reload that changed the type? */ + break; if (f != SERVICE_SUCCESS) { service_enter_signal(s, SERVICE_FINAL_SIGTERM, f); |