updating github.com/godbus/dbus to v4.1.0+incompatible
This commit is contained in:
17
vendor/github.com/godbus/dbus/transport_generic.go
generated
vendored
17
vendor/github.com/godbus/dbus/transport_generic.go
generated
vendored
@@ -4,8 +4,23 @@ import (
|
||||
"encoding/binary"
|
||||
"errors"
|
||||
"io"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
var nativeEndian binary.ByteOrder
|
||||
|
||||
func detectEndianness() binary.ByteOrder {
|
||||
var x uint32 = 0x01020304
|
||||
if *(*byte)(unsafe.Pointer(&x)) == 0x01 {
|
||||
return binary.BigEndian
|
||||
}
|
||||
return binary.LittleEndian
|
||||
}
|
||||
|
||||
func init() {
|
||||
nativeEndian = detectEndianness()
|
||||
}
|
||||
|
||||
type genericTransport struct {
|
||||
io.ReadWriteCloser
|
||||
}
|
||||
@@ -31,5 +46,5 @@ func (t genericTransport) SendMessage(msg *Message) error {
|
||||
return errors.New("dbus: unix fd passing not enabled")
|
||||
}
|
||||
}
|
||||
return msg.EncodeTo(t, binary.LittleEndian)
|
||||
return msg.EncodeTo(t, nativeEndian)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user