summaryrefslogtreecommitdiff
path: root/nslcd_proto
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-12-19 02:00:24 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-12-19 02:00:24 -0500
commit60f22426d52ac3e2b746619bd57298813c4822dc (patch)
treedb87d0b38470b2a8df61b4adbaddcc2d85f47131 /nslcd_proto
parent5aa2dc8085d65c8cfcc46a02ee74ddb9d9032e62 (diff)
Use x/sys/unix instead of the deprecated syscall. BREAKING CHANGE.
This is just a search/replace s/syscall/unix/g in the broken code.
Diffstat (limited to 'nslcd_proto')
-rw-r--r--nslcd_proto/io.go11
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)))