summaryrefslogtreecommitdiff
path: root/internal/ctlsock/ctlsock_serve.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2018-02-27 09:58:14 +0100
committerJakob Unterwurzacher2018-02-27 09:58:14 +0100
commitdb45f2767187a44227fe8bd4c680cdcbd53cc489 (patch)
tree1c20dbd2e0f01d18505702f4b80d38bfa3a7a0a3 /internal/ctlsock/ctlsock_serve.go
parent5fcfd30ddc144f39e47d4259151f633a34f0c082 (diff)
ctlsock: don't Warn() on closed socket
This Warn() is causing panics in the test suite on MacOS: https://github.com/rfjakob/gocryptfs/issues/213
Diffstat (limited to 'internal/ctlsock/ctlsock_serve.go')
-rw-r--r--internal/ctlsock/ctlsock_serve.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/ctlsock/ctlsock_serve.go b/internal/ctlsock/ctlsock_serve.go
index efa72c7..0fd0993 100644
--- a/internal/ctlsock/ctlsock_serve.go
+++ b/internal/ctlsock/ctlsock_serve.go
@@ -60,10 +60,10 @@ func (ch *ctlSockHandler) acceptLoop() {
for {
conn, err := ch.socket.Accept()
if err != nil {
- // TODO Can this warning trigger when the socket it closed on
- // program exit? I have never observed it, but the documentation
- // says that Close() unblocks Accept().
- tlog.Warn.Printf("ctlsock: Accept error: %v", err)
+ // This can trigger on program exit with "use of closed network connection".
+ // Special-casing this is hard due to https://github.com/golang/go/issues/4373
+ // so just don't use tlog.Warn to not cause panics in the tests.
+ tlog.Info.Printf("ctlsock: Accept error: %v", err)
break
}
go ch.handleConnection(conn.(*net.UnixConn))