MCPcopy Create free account
hub / github.com/1player/host-spawn / interpretWaitStatus

Function interpretWaitStatus

command.go:30–41  ·  view source on GitHub ↗

Extract exit code from waitpid(2) status

(status uint32)

Source from the content-addressed store, hash-verified

28
29// Extract exit code from waitpid(2) status
30func interpretWaitStatus(status uint32) (int, bool) {
31 // From /usr/include/bits/waitstatus.h
32 WTERMSIG := status & 0x7f
33 WIFEXITED := WTERMSIG == 0
34
35 if WIFEXITED {
36 WEXITSTATUS := (status & 0xff00) >> 8
37 return int(WEXITSTATUS), true
38 }
39
40 return 0, false
41}
42
43func (c *Command) signal(signal syscall.Signal) error {
44 return c.proxy.Call("org.freedesktop.Flatpak.Development.HostCommandSignal", 0,

Callers 1

waitForSignalsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected