Extract exit code from waitpid(2) status
(status uint32)
| 28 | |
| 29 | // Extract exit code from waitpid(2) status |
| 30 | func 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 | |
| 43 | func (c *Command) signal(signal syscall.Signal) error { |
| 44 | return c.proxy.Call("org.freedesktop.Flatpak.Development.HostCommandSignal", 0, |