tmpfiles: fix detection of unitialized-/etc
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 26 Sep 2022 12:22:49 +0000 (14:22 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 27 Sep 2022 14:48:46 +0000 (16:48 +0200)
commit6db980988fd31559828822180518613f0bdc29bf
tree341fa3a5000292587c1bb7ab30355bcdd86479e5
parent75723d31a678bdd6b9d0160834e54dc09e3dedd1
tmpfiles: fix detection of unitialized-/etc

In 6ec4c852c910b1aca649e87ba3143841334f01fa I changed specifier_machine_id() to
return EUNATCH, but the code catching in tmpfiles wasn't adjusted.

Instead of translating errors at various levels, let the "original" errno value
(whatever was returned by the low-level reading function) propagate all the way
to the logging function, and only check which errnos to suppress there. This
makes it easier to follow the flow of data through all the layers. Also, we
don't need to provide wrapper functions for each place where we want to do the
supression.

The common set of errnos that have similar meaning are are caught using
ERRNO_IS_NOINFO(). It is more managable to use a wider net than to figure out
which errors could be returned in specific cases.
src/tmpfiles/tmpfiles.c