diff options
| author | Ophestra Umiker <cat@ophivana.moe> | 2024-10-17 20:46:25 +0900 |
|---|---|---|
| committer | Ophestra Umiker <cat@ophivana.moe> | 2024-10-17 20:46:48 +0900 |
| commit | 919e5b5cd5deb16087f4a85e2801e73643d7dce4 (patch) | |
| tree | 2e1bafa8e8c27423414a6ee389543308259a660f /internal | |
| parent | 40161c5938a016e6f03ad9b7436eb3bf455626a3 (diff) | |
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>
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/init/main.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/internal/init/main.go b/internal/init/main.go index e79618b2..b70aebca 100644 --- a/internal/init/main.go +++ b/internal/init/main.go @@ -145,11 +145,12 @@ func doInit(fd uintptr) { default: r = 255 } + + go func() { + time.Sleep(residualProcessTimeout) + close(timeout) + }() } - go func() { - time.Sleep(residualProcessTimeout) - close(timeout) - }() case <-done: os.Exit(r) case <-timeout: |
