chiark / gitweb /
tmpfiles: allow Age to be set to 0
authorTom Gundersen <teg@jklm.no>
Mon, 3 Sep 2012 13:07:32 +0000 (15:07 +0200)
committerTom Gundersen <teg@jklm.no>
Tue, 23 Oct 2012 19:53:20 +0000 (21:53 +0200)
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.

man/tmpfiles.d.xml
src/tmpfiles/tmpfiles.c

index a86ef33..86fa439 100644 (file)
@@ -265,7 +265,12 @@ L    /tmp/foobar -    -    -    -   /dev/null</programlisting>
                         </variablelist>
 
                         <para>If multiple integers and units are specified the time
-                        values are summed up.</para>
+                        values are summed up. If an integer is given witohut a unit,
+                        s is assumed.
+                        </para>
+
+                        <para>When the age is set to zero, the files are cleaned
+                        unconditionally.</para>
 
                         <para>The age field only applies to lines starting with
                         d, D and x. If omitted or set to - no automatic clean-up
index c32cbd1..c27d011 100644 (file)
@@ -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);