platform: Add boxdd

This commit is contained in:
世界
2026-08-30 17:41:42 +08:00
parent 2e0466da94
commit 9a543cfe42
37 changed files with 7256 additions and 2 deletions
+30
View File
@@ -0,0 +1,30 @@
//go:build !windows
package main
import (
"net"
"os"
"path/filepath"
)
func listenEndpoint() (net.Listener, error) {
path := socketPath
if path == "" {
path = filepath.Join(workingDirectory, serviceName+".sock")
}
err := os.Remove(path)
if err != nil && !os.IsNotExist(err) {
return nil, err
}
listener, err := net.Listen("unix", path)
if err != nil {
return nil, err
}
err = os.Chmod(path, 0o666)
if err != nil {
listener.Close()
return nil, err
}
return listener, nil
}