From 65fe09caf9bd8cbed9177022c765423885aed5be Mon Sep 17 00:00:00 2001 From: Ophestra Date: Mon, 28 Jul 2025 01:04:29 +0900 Subject: container: check cancel signal delivery This change also makes some parts of the test more robust. Signed-off-by: Ophestra --- container/init.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'container/init.go') 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() -- cgit v1.3.1