]> git.ipfire.org Git - thirdparty/systemd.git/commit
rfkill: move wait_for_initialized() to shared/
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 14 Dec 2018 11:32:33 +0000 (12:32 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 17 Dec 2018 12:50:51 +0000 (13:50 +0100)
commited435031a599335a003f17eac45af5696ffc3a86
treee1ffaa4d494d8902b4f3895d309c50fb1f8b3bc0
parent11c49e6df563e264e6094c4d521c3a2dc8e089b3
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.
src/rfkill/rfkill.c
src/shared/udev-util.c
src/shared/udev-util.h