diff options
Diffstat (limited to 'nslcd_proto')
-rw-r--r-- | nslcd_proto/io.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/nslcd_proto/io.go b/nslcd_proto/io.go index fa40be3..9252aca 100644 --- a/nslcd_proto/io.go +++ b/nslcd_proto/io.go @@ -23,7 +23,8 @@ import ( "io" "net" "reflect" - "syscall" + + "golang.org/x/sys/unix" ) type NslcdError string @@ -72,9 +73,9 @@ func Write(fd io.Writer, data interface{}) { var af int32 = -1 switch len(data) { case net.IPv4len: - af = syscall.AF_INET + af = unix.AF_INET case net.IPv6len: - af = syscall.AF_INET6 + af = unix.AF_INET6 } var bytes []byte if af < 0 { @@ -141,9 +142,9 @@ func Read(fd io.Reader, data interface{}) { Read(fd, &af) var _len int32 switch af { - case syscall.AF_INET: + case unix.AF_INET: _len = net.IPv4len - case syscall.AF_INET6: + case unix.AF_INET6: _len = net.IPv6len default: panic(NslcdError(fmt.Sprintf("incorrect address family specified: %d", af))) |