summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Update.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla/Update.pm')
-rw-r--r--Bugzilla/Update.pm17
1 files changed, 6 insertions, 11 deletions
diff --git a/Bugzilla/Update.pm b/Bugzilla/Update.pm
index 292ab626e..489756406 100644
--- a/Bugzilla/Update.pm
+++ b/Bugzilla/Update.pm
@@ -34,18 +34,13 @@ sub get_notifications {
# Update the local XML file if this one doesn't exist or if
# the last modification time (stat[9]) is older than TIME_INTERVAL.
if (!-e $local_file || (time() - (stat($local_file))[9] > TIME_INTERVAL)) {
- # Are we sure we didn't try to refresh this file already
- # but we failed because we cannot modify its timestamp?
- my $can_alter = (-e $local_file) ? utime(undef, undef, $local_file) : 1;
- if ($can_alter) {
- unlink $local_file; # Make sure the old copy is away.
- my $error = _synchronize_data();
- # If an error is returned, leave now.
- return $error if $error;
- }
- else {
- return {'error' => 'no_update', 'xml_file' => $local_file};
+ unlink $local_file; # Make sure the old copy is away.
+ if (-e $local_file) {
+ return { error => 'no_update', xml_file => $local_file };
}
+ my $error = _synchronize_data();
+ # If an error is returned, leave now.
+ return $error if $error;
}
# If we cannot access the local XML file, ignore it.