diff options
author | Oliver Tappe | 2006-10-14 15:05:54 +0200 |
---|---|---|
committer | Oliver Tappe | 2006-10-14 15:05:54 +0200 |
commit | da91dffd48b9e998ff4634abb1834df7b7a37285 (patch) | |
tree | c556ce815e1651850963d1a468246f39800b0c87 /config-db/slxconfig-demuxer.pl | |
parent | * added message giving the path of the created files and the possibility of e... (diff) | |
download | core-da91dffd48b9e998ff4634abb1834df7b7a37285.tar.gz core-da91dffd48b9e998ff4634abb1834df7b7a37285.tar.xz core-da91dffd48b9e998ff4634abb1834df7b7a37285.zip |
* 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
Diffstat (limited to 'config-db/slxconfig-demuxer.pl')
-rwxr-xr-x | config-db/slxconfig-demuxer.pl | 11 |
1 files changed, 9 insertions, 2 deletions
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 |