révision.

This commit is contained in:
Alexandre Anriot 2005-10-12 20:23:43 +00:00
parent 58c13fb927
commit 4cdaace8d0

View file

@ -14,6 +14,9 @@ use Evoauth::Iptables;
$SIG{INT} = $SIG{TERM} = $SIG{KILL} = ""; $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 # choix des options
my %options=(); my %options=();
getopts("icsrd:a:",\%options); getopts("icsrd:a:",\%options);
@ -46,13 +49,5 @@ sub Usage() {
exit; exit;
} }
BEGIN { close LOCK;
sysopen(LOCK, "/tmp/evoauth.lock", O_WRONLY|O_EXCL|O_CREAT, 0644) unlink "/tmp/evoauth.lock";
or die "Verouillage en cours, sortie : $!";
flock(LOCK, 2);
}
END {
close (LOCK);
}