diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2011-03-12 18:41:02 +0000 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2011-03-12 18:41:02 +0000 |
commit | 77343313c5066402dbff5968a45dc78e811c7434 (patch) | |
tree | 0cf6ab2899d0e406640ef631e089292aafd1b328 | |
parent | Perl syntax. (diff) | |
download | elections-77343313c5066402dbff5968a45dc78e811c7434.tar.gz elections-77343313c5066402dbff5968a45dc78e811c7434.tar.bz2 elections-77343313c5066402dbff5968a45dc78e811c7434.zip |
Missed a second place in votify where the old mtime algorithm was used.
-rwxr-xr-x | votify | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -139,8 +139,16 @@ my ($b) = Ballot->new($election); # Check if the election is open. This should really happen in an # Election class in Votify.pm eventually my ($starttime, $stoptime); -if (stat("$Votify::datadir/start-$election")) { $starttime = (stat _)[9] } -if (stat("$Votify::datadir/stop-$election")) { $stoptime = (stat _)[9] } +my ($startfile) = sprintf "%s/start-%s", $Votify::datadir, $election; +my ($stopfile) = sprintf "%s/stop-%s", $Votify::datadir, $election; +if ( -f $startfile ) { + $starttime = grabfile_int($startfile); + $starttime = (stat _)[9] if stat($startfile) and (!defined($starttime) or ($starttime <= 0)); +} +if ( -f $stopfile ) { + ($stoptime) = grabfile_int($stopfile); + $stoptime = (stat _)[9] if stat($stopfile) and (!defined($stoptime) or ($stoptime <= 0)); +} if ($starttime && $starttime > time) { print "\n", "*" x 75, "\n"; print "WARNING: Specified election doesn't start until ", |