summaryrefslogtreecommitdiff
path: root/nslcd_systemd
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_systemd
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_systemd')
-rw-r--r--nslcd_systemd/nslcd_systemd.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/nslcd_systemd/nslcd_systemd.go b/nslcd_systemd/nslcd_systemd.go
index eb545c2..35c9393 100644
--- a/nslcd_systemd/nslcd_systemd.go
+++ b/nslcd_systemd/nslcd_systemd.go
@@ -38,8 +38,8 @@ import (
"os"
"os/signal"
"sync"
- "syscall"
+ "golang.org/x/sys/unix"
"lukeshu.com/git/go/libnslcd.git/nslcd_server"
"lukeshu.com/git/go/libsystemd.git/sd_daemon"
"lukeshu.com/git/go/libsystemd.git/sd_daemon/lsb"
@@ -69,13 +69,13 @@ func get_socket() (socket net.Listener, err error) {
return
}
-func getpeercred(conn *net.UnixConn) (cred syscall.Ucred, err error) {
+func getpeercred(conn *net.UnixConn) (cred unix.Ucred, err error) {
file, err := conn.File()
if err != nil {
return
}
defer file.Close()
- _cred, err := syscall.GetsockoptUcred(int(file.Fd()), syscall.SOL_SOCKET, syscall.SO_PEERCRED)
+ _cred, err := unix.GetsockoptUcred(int(file.Fd()), unix.SOL_SOCKET, unix.SO_PEERCRED)
cred = *_cred
return
}
@@ -99,7 +99,7 @@ func Main(backend Backend) uint8 {
var err error = nil
sigs := make(chan os.Signal)
- signal.Notify(sigs, syscall.SIGTERM, syscall.SIGHUP)
+ signal.Notify(sigs, unix.SIGTERM, unix.SIGHUP)
disable_nss_module()
@@ -140,10 +140,10 @@ func Main(backend Backend) uint8 {
select {
case sig := <-sigs:
switch sig {
- case syscall.SIGTERM:
+ case unix.SIGTERM:
sd_daemon.Log.Notice("Received SIGTERM, shutting down")
return lsb.EXIT_SUCCESS
- case syscall.SIGHUP:
+ case unix.SIGHUP:
sd_daemon.Notify(0, false, "RELOADING=1", nil)
err := backend.Reload()
if err != nil {