diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-09-03 16:59:14 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-09-03 16:59:14 -0600 |
commit | df78914cae2dc2e3da5170cf3f9c7b412aed3afa (patch) | |
tree | 9817dd885f6a11fe3b9bdd6d56eddfb15e7634ba /src/nslcd_systemd | |
parent | a6c2e22de92f459a52b8151ccc7f7c562c954750 (diff) |
Use a defer/recover block to have the exit status on panic match LSB.
Diffstat (limited to 'src/nslcd_systemd')
-rw-r--r-- | src/nslcd_systemd/nslcd_systemd.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/nslcd_systemd/nslcd_systemd.go b/src/nslcd_systemd/nslcd_systemd.go index dd548ad..c4511ef 100644 --- a/src/nslcd_systemd/nslcd_systemd.go +++ b/src/nslcd_systemd/nslcd_systemd.go @@ -82,6 +82,7 @@ func Main(backend Backend) uint8 { sock := make(chan *net.UnixConn, 1) go func() { + defer lsb.Recover() for { conn, err := socket.Accept() if err != nil { @@ -114,6 +115,7 @@ Loop: case conn := <-sock: wg.Add(1) go func() { + defer lsb.Recover() defer wg.Done() handler(conn, backend) }() |