init: start timeout only if reaped PID is the initial process
Fix a very obvious bug introduced in 5401882ed0
.
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
This commit is contained in:
parent
40161c5938
commit
919e5b5cd5
@ -145,11 +145,12 @@ func doInit(fd uintptr) {
|
|||||||
default:
|
default:
|
||||||
r = 255
|
r = 255
|
||||||
}
|
}
|
||||||
|
|
||||||
|
go func() {
|
||||||
|
time.Sleep(residualProcessTimeout)
|
||||||
|
close(timeout)
|
||||||
|
}()
|
||||||
}
|
}
|
||||||
go func() {
|
|
||||||
time.Sleep(residualProcessTimeout)
|
|
||||||
close(timeout)
|
|
||||||
}()
|
|
||||||
case <-done:
|
case <-done:
|
||||||
os.Exit(r)
|
os.Exit(r)
|
||||||
case <-timeout:
|
case <-timeout:
|
||||||
|
Loading…
Reference in New Issue
Block a user