From 476df1772674e5e377666618b05206b9fa0b98fe Mon Sep 17 00:00:00 2001 From: brl Date: Sun, 7 Jun 2015 19:39:53 -0400 Subject: [PATCH] Don't attempt to set SO_PASSCRED if Listen fails --- ipc/ipc.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ipc/ipc.go b/ipc/ipc.go index d6bfbad..2c87707 100644 --- a/ipc/ipc.go +++ b/ipc/ipc.go @@ -42,13 +42,13 @@ func NewServer(address string, factory MsgFactory, log *logging.Logger, handlers } listener, err := net.ListenUnix("unix", &net.UnixAddr{address, "unix"}) - if err := setPassCred(listener); err != nil { - return nil, errors.New("Failed to set SO_PASSCRED on listening socket: " + err.Error()) - } if err != nil { md.close() return nil, err } + if err := setPassCred(listener); err != nil { + return nil, errors.New("Failed to set SO_PASSCRED on listening socket: " + err.Error()) + } done := make(chan bool) idGen := newIdGen(done) return &MsgServer{