From 4cdaace8d0e44901531a603ab676b6ada4cf1ff8 Mon Sep 17 00:00:00 2001 From: Alexandre Anriot Date: Wed, 12 Oct 2005 20:23:43 +0000 Subject: [PATCH] =?UTF-8?q?r=E9vision.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/Evoauth.pl | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/admin/Evoauth.pl b/admin/Evoauth.pl index 60b8eb3..85a914f 100644 --- a/admin/Evoauth.pl +++ b/admin/Evoauth.pl @@ -14,6 +14,9 @@ use Evoauth::Iptables; $SIG{INT} = $SIG{TERM} = $SIG{KILL} = ""; +sysopen(LOCK, "/tmp/evoauth.lock", O_WRONLY|O_EXCL|O_CREAT) + or die "Le verouillage a chou."; + # choix des options my %options=(); getopts("icsrd:a:",\%options); @@ -46,13 +49,5 @@ sub Usage() { exit; } -BEGIN { - sysopen(LOCK, "/tmp/evoauth.lock", O_WRONLY|O_EXCL|O_CREAT, 0644) - or die "Verouillage en cours, sortie : $!"; - - flock(LOCK, 2); -} - -END { - close (LOCK); -} +close LOCK; +unlink "/tmp/evoauth.lock";