mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-19 01:40:13 +00:00
This updates vendored runc/libcontainer to 1.1.0, and google/cadvisor to a version updated to runc 1.1.0 (google/cadvisor#3048). Changes in vendor are generated by (roughly): ./hack/pin-dependency.sh github.com/google/cadvisor v0.44.0 ./hack/pin-dependency.sh github.com/opencontainers/runc v1.1.0 ./hack/update-vendor.sh ./hack/lint-dependencies.sh # And follow all its recommendations. ./hack/update-vendor.sh ./hack/update-internal-modules.sh ./hack/lint-dependencies.sh # Re-check everything again. Co-Authored-By: Kir Kolyshkin <kolyshkin@gmail.com>
53 lines
917 B
Go
53 lines
917 B
Go
package dbus
|
|
|
|
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
|
|
}
|
|
|
|
func (t genericTransport) SendNullByte() error {
|
|
_, err := t.Write([]byte{0})
|
|
return err
|
|
}
|
|
|
|
func (t genericTransport) SupportsUnixFDs() bool {
|
|
return false
|
|
}
|
|
|
|
func (t genericTransport) EnableUnixFDs() {}
|
|
|
|
func (t genericTransport) ReadMessage() (*Message, error) {
|
|
return DecodeMessage(t)
|
|
}
|
|
|
|
func (t genericTransport) SendMessage(msg *Message) error {
|
|
fds, err := msg.CountFds()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if fds != 0 {
|
|
return errors.New("dbus: unix fd passing not enabled")
|
|
}
|
|
return msg.EncodeTo(t, nativeEndian)
|
|
}
|