fmsg: support temporarily withholding output
All checks were successful
test / test (push) Successful in 31s

Trying to print to a shared stdout is a terrible idea. This change makes it possible to withhold output for the lifetime of the sandbox.

Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
This commit is contained in:
2024-10-26 23:09:32 +09:00
parent 093e99d062
commit ae1a102882
11 changed files with 105 additions and 32 deletions

View File

@@ -129,7 +129,7 @@ func doInit(fd uintptr) {
select {
case s := <-sig:
fmsg.VPrintln("received", s.String())
os.Exit(0)
fmsg.Exit(0)
case w := <-info:
if w.wpid == cmd.Process.Pid {
switch {
@@ -147,10 +147,10 @@ func doInit(fd uintptr) {
}()
}
case <-done:
os.Exit(r)
fmsg.Exit(r)
case <-timeout:
fmsg.Println("timeout exceeded waiting for lingering processes")
os.Exit(r)
fmsg.Exit(r)
}
}
}