platform: Add service error wrapper for macOS system extension

This commit is contained in:
世界 2024-01-22 18:27:06 +08:00
parent 94f76d6671
commit a8ee41715a
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
4 changed files with 48 additions and 14 deletions

View file

@ -93,13 +93,11 @@ func (s *CommandServer) listenUNIX() error {
if err != nil {
return E.Cause(err, "listen ", sockPath)
}
if sUserID > 0 {
err = os.Chown(sockPath, sUserID, sGroupID)
if err != nil {
listener.Close()
os.Remove(sockPath)
return E.Cause(err, "chown")
}
err = os.Chown(sockPath, sUserID, sGroupID)
if err != nil {
listener.Close()
os.Remove(sockPath)
return E.Cause(err, "chown")
}
s.listener = listener
go s.loopConnection(listener)