(sig os.Signal)
| 43 | } |
| 44 | |
| 45 | func GetSignalName(sig os.Signal) string { |
| 46 | if sig == nil { |
| 47 | return "" |
| 48 | } |
| 49 | scSig, ok := sig.(syscall.Signal) |
| 50 | if !ok { |
| 51 | return sig.String() |
| 52 | } |
| 53 | name := unix.SignalName(scSig) |
| 54 | if name == "" { |
| 55 | return fmt.Sprintf("%d", int(scSig)) |
| 56 | } |
| 57 | return name |
| 58 | } |
| 59 | |
| 60 | func SetCloseOnExec(fd int) { |
| 61 | unix.CloseOnExec(fd) |
no test coverage detected