Don't attempt to set SO_PASSCRED if Listen fails

networking
brl 10 years ago
parent 7535992e63
commit 476df17726

@ -42,13 +42,13 @@ func NewServer(address string, factory MsgFactory, log *logging.Logger, handlers
} }
listener, err := net.ListenUnix("unix", &net.UnixAddr{address, "unix"}) 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 { if err != nil {
md.close() md.close()
return nil, err 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) done := make(chan bool)
idGen := newIdGen(done) idGen := newIdGen(done)
return &MsgServer{ return &MsgServer{

Loading…
Cancel
Save