]> git.ipfire.org Git - thirdparty/systemd.git/commit
time-util: Introduce parse_sec_def_infinity
authorFilipe Brandenburger <filbranden@google.com>
Thu, 24 Jan 2019 03:48:54 +0000 (19:48 -0800)
committerFilipe Brandenburger <filbranden@google.com>
Thu, 14 Feb 2019 19:04:42 +0000 (11:04 -0800)
commit7b61ce3c44ef5908e817009ce4f9d2a7a37722be
treec0e8cdc688bd5904c5743b25364ef2514ad763ae
parent93e4163e912b6895e61c43452a629f30a28eb70c
time-util: Introduce parse_sec_def_infinity

This works like parse_sec() but defaults to USEC_INFINITY when passed an
empty string or only whitespace.

Also introduce config_parse_sec_def_infinity, which can be used to parse
config options using this function.

This is useful for time options that use "infinity" for default and that
can be reset by unsetting them.

Introduce a test case to ensure it works as expected.
src/basic/time-util.c
src/basic/time-util.h
src/shared/conf-parser.c
src/shared/conf-parser.h
src/test/test-time-util.c