Otherwise we can repeatedly gc the same thing.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
$mode_what = 'garbage collecting';
$mode_locknb = 0;
$mode_action = sub {
+ my ($needsgc, $gcmsg) = $gccheck->();
+ if (!$needsgc) {
+ logm 'info',
+ "housekeeping: subdirs $subdir: someone else has gc'd";
+ return;
+ }
+ logm 'debug', "housekeeping: subdirs $subdir: $gcmsg (2)";
my $gclog = "$subdir/gc.log";
unlink $gclog or $!==ENOENT or hkfail "remove $gclog: $!";
my $child = fork // hkfail "fork (for $subdir): $!";