diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-08-28 20:43:12 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-08-28 20:43:12 -0600 |
commit | b55355121e0ed259097254447f16739b0f3da61d (patch) | |
tree | 3149a5cfe50952e9a3ea6c9a9e888b3da72dbfff /src/nslcd_systemd | |
parent | 3c237531f5067340e34b01c7f7ea45fa55c39657 (diff) |
implement hackers_watch
Diffstat (limited to 'src/nslcd_systemd')
-rw-r--r-- | src/nslcd_systemd/nslcd_systemd.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nslcd_systemd/nslcd_systemd.go b/src/nslcd_systemd/nslcd_systemd.go index 9868581..3d87310 100644 --- a/src/nslcd_systemd/nslcd_systemd.go +++ b/src/nslcd_systemd/nslcd_systemd.go @@ -14,7 +14,7 @@ import ( type Backend interface { nslcd_proto.Backend - Reload() + Reload() error } func get_socket() (socket net.Listener, err error) { @@ -60,7 +60,7 @@ func handler(conn *net.UnixConn, backend nslcd_proto.Backend) { } } -func Main(backend Backend) { +func Main(backend Backend) int { var err error = nil var socket net.Listener = nil defer func() { @@ -73,7 +73,7 @@ func Main(backend Backend) { if err != nil { logger.Err("%s", err.Error()) sd.Notify(false, "STOPPING=1") - os.Exit(1) + return 1 } sigs := make(chan os.Signal, 1) @@ -115,5 +115,5 @@ Loop: } wg.Wait() - os.Exit(0) + return 0 } |