Timothy Pearson 12 years ago
commit 0cc58e60f4

@ -2231,7 +2231,7 @@ DONE
sub get_lock sub get_lock
{ {
my $lockfile = "$ENV{HOME}/.tdesvn-lock"; my $lockfile = "$ENV{HOME}/.tdesvn-lock";
sysopen LOCTDEFILE, $lockfile, O_WRONLY | O_CREAT | O_EXCL; sysopen LOCKFILE, $lockfile, O_WRONLY | O_CREAT | O_EXCL;
my $errorCode = $!; # Save for later testing. my $errorCode = $!; # Save for later testing.
# Install signal handlers to ensure that the lockfile gets closed. # Install signal handlers to ensure that the lockfile gets closed.
@ -2298,16 +2298,16 @@ sub get_lock
# twice. # twice.
warning " y[WARNING]: stale tdesvn-build lockfile found, deleting."; warning " y[WARNING]: stale tdesvn-build lockfile found, deleting.";
unlink $lockfile; unlink $lockfile;
sysopen LOCTDEFILE, $lockfile, O_WRONLY | O_CREAT | O_EXCL and do sysopen LOCKFILE, $lockfile, O_WRONLY | O_CREAT | O_EXCL and do
{ {
print LOCTDEFILE "$$\n"; print LOCKFILE "$$\n";
close LOCTDEFILE; close LOCKFILE;
}; };
return 1; # Hope the sysopen worked. return 1; # Hope the sysopen worked.
} }
print LOCTDEFILE "$$\n"; print LOCKFILE "$$\n";
close LOCTDEFILE; close LOCKFILE;
# Even if we fail it's generally better to allow the script to proceed # Even if we fail it's generally better to allow the script to proceed
# without being a jerk about things, especially as more non-CLI-skilled # without being a jerk about things, especially as more non-CLI-skilled
@ -2320,7 +2320,7 @@ sub close_lock
{ {
my $lockfile = "$ENV{HOME}/.tdesvn-lock"; my $lockfile = "$ENV{HOME}/.tdesvn-lock";
close LOCTDEFILE; close LOCKFILE;
unlink $lockfile; unlink $lockfile;
} }

Loading…
Cancel
Save