use strict/warnings and fix bug that was obvious once used.

This commit is contained in:
Bradley M. Kuhn 2013-11-29 16:27:00 -05:00
parent c8e8171253
commit 1f55b78af5

View file

@ -67,6 +67,9 @@
# You should have received a copy of the GNU General Public License,
# version 3. If not, see <http://www.gnu.org/licenses/>
use strict;
use warnings;
use POSIX ":sys_wait_h";
use Fcntl; # for sysopen
use Carp;
@ -396,14 +399,14 @@ END_ICAL
}
$newCalendar->add_entry($entry);
}
open(SCRUBBED_CAL, ">$file") or
DieLog("Unable to overwrite $file: $!", $LOCK_CLEANUP_CODE);
print SCRUBBED_CAL $newCalendar->as_string;
close SCRUBBED_CAL;
DieLog("Error when writing $file: $!", $LOCK_CLEANUP_CODE)
unless $? == 0;
undef $newCalendar;
}
open(SCRUBBED_CAL, ">$file") or
DieLog("Unable to overwrite $file: $!", $LOCK_CLEANUP_CODE);
print SCRUBBED_CAL $newCalendar->as_string;
close SCRUBBED_CAL;
DieLog("Error when writing $file: $!", $LOCK_CLEANUP_CODE)
unless $? == 0;
undef $newCalendar;
}
######################################################################
sub PrivatizeMergeAndTZIcalFile ($$$$$$) {