]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/cryptsetup/cryptsetup-generator.c
cryptsetup-generator: unconfuse writing of the device timeout
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 3 Dec 2019 15:06:47 +0000 (16:06 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 3 Dec 2019 16:20:19 +0000 (17:20 +0100)
commit7cecc563163f539c497ecdf5ab00729fcd8c97c1
tree426dd98779262ebe7dabeacf538bd2cfc162cd84
parentcb515608030fe05f4a46ed32e1cd30aaca6e3381
cryptsetup-generator: unconfuse writing of the device timeout

The code was using timeout=0 as the default option string. This option string
was ultimately passed to generator_write_timeouts(), which only looks for
comment=systemd.device-timeout= or x-systemd.device-timeout=, i.e. the whole
call path was bogus. Let's rework this: generator_write_timeouts() now writes
any timeouts if configured by the user. create_disk() writes out it's own
timeout, but with lower priority. Since the code path that was calling
timeout=0 was not effective, the only change is that we stop overwriting the
timeout if explicitly configured by the user.

In both code paths, ignore failure to write.
src/cryptsetup/cryptsetup-generator.c
src/shared/generator.c