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
4 changed files with 48 additions and 14 deletions

View File

@@ -20,13 +20,11 @@ func RedirectStderr(path string) error {
return err
}
if runtime.GOOS != "android" {
if sUserID > 0 {
err = outputFile.Chown(sUserID, sGroupID)
if err != nil {
outputFile.Close()
os.Remove(outputFile.Name())
return err
}
err = outputFile.Chown(sUserID, sGroupID)
if err != nil {
outputFile.Close()
os.Remove(outputFile.Name())
return err
}
}
err = unix.Dup2(int(outputFile.Fd()), int(os.Stderr.Fd()))