From c138ddc35f710a2be6e9d75a1fabcb04bc2f7281 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Sun, 8 Jun 2008 18:09:54 +0000 Subject: * 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 --- lib/OpenSLX/ScopedResource.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/OpenSLX/ScopedResource.pm') 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} != $$; -- cgit v1.2.3-55-g7522