X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flibelogind%2Fsd-device%2Fdevice-private.c;fp=src%2Flibelogind%2Fsd-device%2Fdevice-private.c;h=544b837b12f6c378c13dbabc86c70c5559dab4ce;hb=ccae5a25c961d456a0b42da4bd8b0f8d39c530d9;hp=f6beef84949bb6bbd406240e6670c81e308578b7;hpb=c07733f7e14a3a1ff86b0fa5595c88058a78f613;p=elogind.git diff --git a/src/libelogind/sd-device/device-private.c b/src/libelogind/sd-device/device-private.c index f6beef849..544b837b1 100644 --- a/src/libelogind/sd-device/device-private.c +++ b/src/libelogind/sd-device/device-private.c @@ -641,6 +641,9 @@ static int device_update_properties_bufs(sd_device *device) { assert(device); + if (!device->properties_buf_outdated) + return 0; + FOREACH_DEVICE_PROPERTY(device, prop, val) { size_t len = 0; @@ -677,11 +680,9 @@ int device_get_properties_nulstr(sd_device *device, const uint8_t **nulstr, size assert(nulstr); assert(len); - if (device->properties_buf_outdated) { - r = device_update_properties_bufs(device); - if (r < 0) - return r; - } + r = device_update_properties_bufs(device); + if (r < 0) + return r; *nulstr = device->properties_nulstr; *len = device->properties_nulstr_len;