return "unknown sort type $params{sort}";
}
+ if (exists $params{skip}) {
+ @list=@list[$params{skip} .. scalar @list - 1];
+ }
+
if ($params{show} && @list > $params{show}) {
@list=@list[0..$params{show} - 1];
}
my $time=shift;
eval q{use POSIX};
+ error($@) if $@;
my $lc_time= POSIX::setlocale(&POSIX::LC_TIME);
POSIX::setlocale(&POSIX::LC_TIME, "C");
my $ret=POSIX::strftime("%a, %d %b %Y %H:%M:%S %z", localtime($time));
my $time=shift;
eval q{use POSIX};
+ error($@) if $@;
my $lc_time= POSIX::setlocale(&POSIX::LC_TIME);
POSIX::setlocale(&POSIX::LC_TIME, "C");
my $ret=POSIX::strftime("%Y-%m-%dT%H:%M:%SZ", localtime($time));
return;
}
- # TODO: daemonize here so slow pings don't slow down wiki updates
+ # daemonize here so slow pings don't slow down wiki updates
+ eval q{use POSIX ’setsid’};
+ chdir '/';
+ open STDIN, '/dev/null';
+ open STDOUT, '>/dev/null';
+ defined(my $pid = fork) or error("Can't fork: $!");
+ return if $pid;
+ setsid() or error("Can't start a new session: $!");
+ open STDERR, '>&STDOUT' or error("Can’t dup stdout: $!");
foreach my $page (keys %toping) {
my $title=pagetitle(basename($page));