From: Tom Gundersen Date: Mon, 3 Sep 2012 13:07:32 +0000 (+0200) Subject: tmpfiles: allow Age to be set to 0 X-Git-Tag: v196~251 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=a2558205f762ce6f1374cea0eedf5e76a6134f41 tmpfiles: allow Age to be set to 0 Mostly useful for testing purposes. Setting Age to 1s works just as well, but it is surprising that using 0s (or just 0) does not work. Also clarify this in the documentation. --- diff --git a/man/tmpfiles.d.xml b/man/tmpfiles.d.xml index a86ef3369..86fa4394c 100644 --- a/man/tmpfiles.d.xml +++ b/man/tmpfiles.d.xml @@ -265,7 +265,12 @@ L /tmp/foobar - - - - /dev/null If multiple integers and units are specified the time - values are summed up. + values are summed up. If an integer is given witohut a unit, + s is assumed. + + + When the age is set to zero, the files are cleaned + unconditionally. The age field only applies to lines starting with d, D and x. If omitted or set to - no automatic clean-up diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index c32cbd1ae..c27d0112f 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c @@ -409,7 +409,7 @@ static int clean_item(Item *i) { i->type != IGNORE_PATH) return 0; - if (!i->age_set || i->age <= 0) + if (!i->age_set) return 0; n = now(CLOCK_REALTIME);