From da91dffd48b9e998ff4634abb1834df7b7a37285 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Sat, 14 Oct 2006 13:05:54 +0000 Subject: * avoid confusing error message about existing lock-file when in fact the script could not create the file for missing write permissions. git-svn-id: http://svn.openslx.org/svn/openslx/trunk@463 95ad53e4-c205-0410-b2fa-d234c58c8868 --- config-db/slxconfig-demuxer.pl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'config-db') diff --git a/config-db/slxconfig-demuxer.pl b/config-db/slxconfig-demuxer.pl index a0557089..62780f17 100755 --- a/config-db/slxconfig-demuxer.pl +++ b/config-db/slxconfig-demuxer.pl @@ -135,8 +135,15 @@ sub lockScript unlink $lockFile; } } - sysopen(LOCKFILE, $lockFile, O_RDWR|O_CREAT|O_EXCL) - or die _tr(qq[Lock-file <%s> exists, script is already running.\nPlease remove the logfile and try again if you are sure that no one else is executing this script.], $lockFile); + if (!sysopen(LOCKFILE, $lockFile, O_RDWR|O_CREAT|O_EXCL)) { + if ($! == 13) { + die _tr(qq[Unable to create lock-file <%s>, exiting!\n], $lockFile); + } else { + die _tr(qq[Lock-file <%s> exists, script is already running. +Please remove the logfile and try again if you are sure that no one else +is executing this script.\n], $lockFile); + } + } } sub unlockScript -- cgit v1.2.3-55-g7522