sd-device: attempt to read db again if it wasn't found
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 13 Dec 2018 14:41:09 +0000 (15:41 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 16 Dec 2018 18:52:58 +0000 (19:52 +0100)
commitcd53c8f97d6247a7c73b0bde32789581bf444b3d
tree6338aab3a0533a4ee52d798a1d8fce8a2c8d0571
parent421e3b45f03dd6b7f8dd99258dda44428b384889
sd-device: attempt to read db again if it wasn't found

This mostly reverts "sd-device: don't retry loading uevent/db files more than
once", 7141e4f62c3f220872df3114c42d9e4b9525e43e. We will retry if we couldn't
access the file, but not if parsing failed.

Not re-reading the database at all just doesn't seem like a good idea. We have
two implementations of device_read_db, and one does that, and the other retries
to read the db. Re-reading seems more useful, since we can create the object
and then access properties as some later time when we know that the device has
been initialized and we can get useful results. Otherwise, we force the user to
destroy this object and create a new one.

This changes device_read_uevent_file() and device_read_db_aux(). See next
commit for description of where those functions are used.
src/libsystemd/sd-device/sd-device.c