service: don't wait for any child unless we no its pid

This commit is contained in:
Lennart Poettering 2010-04-24 02:05:42 +02:00
parent 4e8e228865
commit e93bc5a61f
2 changed files with 2 additions and 2 deletions

View File

@ -1413,7 +1413,7 @@ static void service_enter_signal(Service *s, ServiceState state, bool success) {
}
}
if (sent) {
if (sent && (s->main_pid > 0 || s->control_pid > 0)) {
if (s->timeout_usec > 0)
if ((r = unit_watch_timer(UNIT(s), s->timeout_usec, &s->timer_watch)) < 0)
goto fail;

View File

@ -667,7 +667,7 @@ static void socket_enter_signal(Socket *s, SocketState state, bool success) {
}
}
if (sent) {
if (sent && s->control_pid > 0) {
if ((r = unit_watch_timer(UNIT(s), s->timeout_usec, &s->timer_watch)) < 0)
goto fail;