summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2011-03-12 18:41:02 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2011-03-12 18:41:02 +0000
commit77343313c5066402dbff5968a45dc78e811c7434 (patch)
tree0cf6ab2899d0e406640ef631e089292aafd1b328
parentPerl syntax. (diff)
downloadelections-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-xvotify12
1 files changed, 10 insertions, 2 deletions
diff --git a/votify b/votify
index 2ed6926..e607d66 100755
--- a/votify
+++ b/votify
@@ -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 ",