diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-07-28 01:04:29 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-07-28 01:04:29 +0900 |
| commit | 65fe09caf9bd8cbed9177022c765423885aed5be (patch) | |
| tree | 68600dafad417f2bc9bd2f246c51fdea4aad3fb3 /container/init.go | |
| parent | a1e5f020f48a65138c900961f856cf6b04833770 (diff) | |
container: check cancel signal delivery
This change also makes some parts of the test more robust.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'container/init.go')
| -rw-r--r-- | container/init.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/container/init.go b/container/init.go index 8853bd8b..757af58c 100644 --- a/container/init.go +++ b/container/init.go @@ -367,9 +367,11 @@ func Init(prepare func(prefix string), setVerbose func(verbose bool)) { } } +const initName = "init" + // TryArgv0 calls [Init] if the last element of argv0 is "init". func TryArgv0(v Msg, prepare func(prefix string), setVerbose func(verbose bool)) { - if len(os.Args) > 0 && path.Base(os.Args[0]) == "init" { + if len(os.Args) > 0 && path.Base(os.Args[0]) == initName { msg = v Init(prepare, setVerbose) msg.BeforeExit() |
