This commit is contained in:
bluepython508 committed 2026-10-22 12:27:19 +01:00
1 parent 3530afb854
commit 6903fcff27
2146 files changed
+112256 -190703

No files matched your search

+23 -1
View File
@@ -1,9 +1,9 @@
//go:build !windows && !solaris && !darwin
// +build !windows,!solaris,!darwin
package dbus
import (
"net"
"os"
)
@@ -16,3 +16,25 @@ func getSystemBusPlatformAddress() string {
}
return defaultSystemBusAddress
}
// DialUnix establishes a new private connection to the message bus specified by UnixConn.
func DialUnix(conn *net.UnixConn, opts ...ConnOption) (*Conn, error) {
tr := newUnixTransportFromConn(conn)
return newConn(tr, opts...)
}
func ConnectUnix(uconn *net.UnixConn, opts ...ConnOption) (*Conn, error) {
conn, err := DialUnix(uconn, opts...)
if err != nil {
return nil, err
}
if err = conn.Auth(conn.auth); err != nil {
_ = conn.Close()
return nil, err
}
if err = conn.Hello(); err != nil {
_ = conn.Close()
return nil, err
}
return conn, nil
}