()
| 44 | var ErrNoNotifySock = errors.New("no systemd socket") |
| 45 | |
| 46 | func sdNotifySock() (*net.UnixConn, error) { |
| 47 | sockAddr := os.Getenv("NOTIFY_SOCKET") |
| 48 | if sockAddr == "" { |
| 49 | return nil, ErrNoNotifySock |
| 50 | } |
| 51 | if strings.HasPrefix(sockAddr, "@") { |
| 52 | sockAddr = "\x00" + sockAddr[1:] |
| 53 | } |
| 54 | |
| 55 | return net.DialUnix("unixgram", nil, &net.UnixAddr{ |
| 56 | Name: sockAddr, |
| 57 | Net: "unixgram", |
| 58 | }) |
| 59 | } |
| 60 | |
| 61 | func setScmPassCred(sock *net.UnixConn) error { |
| 62 | sConn, err := sock.SyscallConn() |
no outgoing calls
no test coverage detected