mirror of
https://github.com/containers/podman.git
synced 2025-05-20 08:36:23 +08:00

This should never be pulled into the remote client. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
21 lines
387 B
Go
21 lines
387 B
Go
//go:build !remote
|
|
// +build !remote
|
|
|
|
package libpod
|
|
|
|
import (
|
|
"fmt"
|
|
"net"
|
|
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
func openUnixSocket(path string) (*net.UnixConn, error) {
|
|
fd, err := unix.Open(path, unix.O_PATH, 0)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
defer unix.Close(fd)
|
|
return net.DialUnix("unixpacket", nil, &net.UnixAddr{Name: fmt.Sprintf("/proc/self/fd/%d", fd), Net: "unixpacket"})
|
|
}
|