summaryrefslogtreecommitdiff
path: root/vendor/github.com/godbus/dbus/v5/dbus.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-02-28 18:41:28 -0500
committerGitHub <noreply@github.com>2022-02-28 18:41:28 -0500
commit4c529529bd19c3cc73f630f39bb2b8df68374ad3 (patch)
tree119fc94c898b87e2235ec50aede6497ac6ec6fb2 /vendor/github.com/godbus/dbus/v5/dbus.go
parentc39dffe83db9fa3cfa6897b971956821f1bbcce2 (diff)
parent2e14c72707afc1625874b5fd4367b0bc418994a1 (diff)
downloadpodman-4c529529bd19c3cc73f630f39bb2b8df68374ad3.tar.gz
podman-4c529529bd19c3cc73f630f39bb2b8df68374ad3.tar.bz2
podman-4c529529bd19c3cc73f630f39bb2b8df68374ad3.zip
Merge pull request #13372 from ashley-cui/binarypath
Allow setting binarypath from Makefile
Diffstat (limited to 'vendor/github.com/godbus/dbus/v5/dbus.go')
-rw-r--r--vendor/github.com/godbus/dbus/v5/dbus.go14
1 files changed, 6 insertions, 8 deletions
diff --git a/vendor/github.com/godbus/dbus/v5/dbus.go b/vendor/github.com/godbus/dbus/v5/dbus.go
index ddf3b7afd..c188d1048 100644
--- a/vendor/github.com/godbus/dbus/v5/dbus.go
+++ b/vendor/github.com/godbus/dbus/v5/dbus.go
@@ -122,8 +122,11 @@ func isConvertibleTo(dest, src reflect.Type) bool {
case dest.Kind() == reflect.Slice:
return src.Kind() == reflect.Slice &&
isConvertibleTo(dest.Elem(), src.Elem())
+ case dest.Kind() == reflect.Ptr:
+ dest = dest.Elem()
+ return isConvertibleTo(dest, src)
case dest.Kind() == reflect.Struct:
- return src == interfacesType
+ return src == interfacesType || dest.Kind() == src.Kind()
default:
return src.ConvertibleTo(dest)
}
@@ -274,13 +277,8 @@ func storeSliceIntoInterface(dest, src reflect.Value) error {
func storeSliceIntoSlice(dest, src reflect.Value) error {
if dest.IsNil() || dest.Len() < src.Len() {
dest.Set(reflect.MakeSlice(dest.Type(), src.Len(), src.Cap()))
- }
- if dest.Len() != src.Len() {
- return fmt.Errorf(
- "dbus.Store: type mismatch: "+
- "slices are different lengths "+
- "need: %d have: %d",
- src.Len(), dest.Len())
+ } else if dest.Len() > src.Len() {
+ dest.Set(dest.Slice(0, src.Len()))
}
for i := 0; i < src.Len(); i++ {
err := store(dest.Index(i), getVariantValue(src.Index(i)))