summaryrefslogtreecommitdiffstats
path: root/lib/OpenSLX/ScopedResource.pm
diff options
context:
space:
mode:
authorOliver Tappe2008-06-08 20:09:54 +0200
committerOliver Tappe2008-06-08 20:09:54 +0200
commitc138ddc35f710a2be6e9d75a1fabcb04bc2f7281 (patch)
treed25ab325874956e359ed11fb2132c85c50de667d /lib/OpenSLX/ScopedResource.pm
parent* refactored locking file to make use of ScopedResource (diff)
downloadcore-c138ddc35f710a2be6e9d75a1fabcb04bc2f7281.tar.gz
core-c138ddc35f710a2be6e9d75a1fabcb04bc2f7281.tar.xz
core-c138ddc35f710a2be6e9d75a1fabcb04bc2f7281.zip
* increased robustness against leaking resources by ignoring INT-signals when
trying to release a resource (a.k.a. umount a folder) git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@1868 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'lib/OpenSLX/ScopedResource.pm')
-rw-r--r--lib/OpenSLX/ScopedResource.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/OpenSLX/ScopedResource.pm b/lib/OpenSLX/ScopedResource.pm
index f278f871..3334ecde 100644
--- a/lib/OpenSLX/ScopedResource.pm
+++ b/lib/OpenSLX/ScopedResource.pm
@@ -55,7 +55,7 @@ is spread across different process and/or makes us of signal handlers.
=cut
-# make sure that we catch any signals in order to properly released scoped
+# make sure that we catch any signals in order to properly release scoped
# resources
use sigtrap qw( die normal-signals error-signals );
@@ -152,6 +152,10 @@ sub _release
{
my $self = shift;
+ # ignore ctrl-c while we are trying to release the resource, as otherwise
+ # the resource would be leaked
+ local $SIG{INT} = 'IGNORE';
+
# only release the resource if invoked by the owning process
vlog(3, "process $$ tries to release resource $self->{name}");
return if $self->{owner} != $$;