diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-12-14 12:32:33 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-12-17 13:50:51 +0100 |
commit | ed435031a599335a003f17eac45af5696ffc3a86 (patch) | |
tree | e1ffaa4d494d8902b4f3895d309c50fb1f8b3bc0 /src/shared/udev-util.h | |
parent | sd-device: remove holes in struct sd_device (diff) | |
download | systemd-ed435031a599335a003f17eac45af5696ffc3a86.tar.xz systemd-ed435031a599335a003f17eac45af5696ffc3a86.zip |
rfkill: move wait_for_initialized() to shared/
The function interface is the same, except that the output pointer may be NULL.
The implementation is slightly simplified by taking advantage of changes in
ancestor commit 'sd-device: attempt to read db again if it wasn't found', by
not creating a new sd_device object before re-checking the is_initialized
status.
v2:
- In v1, the old object was always used and the device received back from the
sd_device_monitor_start callback was ignored. I *think* the result will be
equivalent in both cases, because by the time we the callback gets called,
the db entry in the filesystem will also exist, and any subsequent access to
properties of the object would trigger a read of the database from disk. But
I'm not certain, and anyway, using the device object received in the callback
seems cleaner.
Diffstat (limited to 'src/shared/udev-util.h')
-rw-r--r-- | src/shared/udev-util.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/shared/udev-util.h b/src/shared/udev-util.h index be08fe1ff8..932c4a9cd5 100644 --- a/src/shared/udev-util.h +++ b/src/shared/udev-util.h @@ -1,6 +1,8 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ #pragma once +#include "sd-device.h" + #include "time-util.h" typedef enum ResolveNameTiming { @@ -23,3 +25,5 @@ int udev_parse_config_full( static inline int udev_parse_config(void) { return udev_parse_config_full(NULL, NULL, NULL, NULL); } + +int device_wait_for_initialization(sd_device *device, const char *subsystem, sd_device **ret); |