diff options
Diffstat (limited to 'src/nslcd_proto/io.go')
-rw-r--r-- | src/nslcd_proto/io.go | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/nslcd_proto/io.go b/src/nslcd_proto/io.go index 0804e98..e31aabc 100644 --- a/src/nslcd_proto/io.go +++ b/src/nslcd_proto/io.go @@ -6,11 +6,9 @@ import ( "io" "net" "reflect" + "syscall" ) -//#include <sys/socket.h> -import "C" - type NslcdObject interface { NslcdWrite(fd io.Writer) } @@ -46,9 +44,9 @@ func write(fd io.Writer, data interface{}) { var af int32 = -1 switch len(data) { case net.IPv4len: - af = C.AF_INET + af = syscall.AF_INET case net.IPv6len: - af = C.AF_INET6 + af = syscall.AF_INET6 } var bytes []byte if af < 0 { @@ -112,9 +110,9 @@ func read(fd io.Reader, data interface{}) { read(fd, &af) var _len int32 switch af { - case C.AF_INET: + case syscall.AF_INET: _len = net.IPv4len - case C.AF_INET6: + case syscall.AF_INET6: _len = net.IPv6len default: panic(NslcdError(fmt.Sprintf("incorrect address family specified: %d", af))) |