Add lock cleanup code.
This commit is contained in:
parent
7a03e2220d
commit
c51c26f280
1 changed files with 15 additions and 1 deletions
|
@ -46,7 +46,21 @@ use File::Temp qw/:POSIX tempfile/;
|
||||||
use DateTime::TimeZone;
|
use DateTime::TimeZone;
|
||||||
use Date::Manip;
|
use Date::Manip;
|
||||||
use DateTime::Format::ICal;
|
use DateTime::Format::ICal;
|
||||||
use Date::ICal;
|
|
||||||
|
my($CONFIG_FILE) = (@ARGV);
|
||||||
|
|
||||||
|
if (@ARGV != 1) {
|
||||||
|
print STDERR "usage: $0 <CONFIG_FILE>\n";
|
||||||
|
exit 1;
|
||||||
|
}
|
||||||
|
###############################################################################
|
||||||
|
my $CALENDAR_LOCK_FILE = "$ENV{HOME}/.emacs-calendar-to-ics-lock";
|
||||||
|
|
||||||
|
my $LOCK_CLEANUP_CODE = sub {
|
||||||
|
return (unlink($CALENDAR_LOCK_FILE) != 1) ?
|
||||||
|
"Failed unlink of $CALENDAR_LOCK_FILE. Could cause trouble." :
|
||||||
|
"";
|
||||||
|
};
|
||||||
###############################################################################
|
###############################################################################
|
||||||
{
|
{
|
||||||
my %messageHistory;
|
my %messageHistory;
|
||||||
|
|
Loading…
Add table
Reference in a new issue