From d7f33dac5d1a846181dee9c159b000eee1472414 Mon Sep 17 00:00:00 2001 From: janw Date: Wed, 11 Mar 2009 12:43:53 +0000 Subject: [PATCH] Added flocks to daemon_log. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@13526 594d385d-05f5-0310-b6e9-bd551577e9d8 --- trunk/gosa-si/gosa-si-server | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/trunk/gosa-si/gosa-si-server b/trunk/gosa-si/gosa-si-server index 9191d3e85..d13b4212d 100755 --- a/trunk/gosa-si/gosa-si-server +++ b/trunk/gosa-si/gosa-si-server @@ -28,7 +28,7 @@ use Getopt::Long; use Config::IniFiles; use POSIX; -use Fcntl; +use Fcntl qw/:flock/; use IO::Socket::INET; use IO::Handle; use IO::Select; @@ -352,7 +352,10 @@ sub daemon_log { my $name = $prg; my $log_msg = "$month $monthday $hours:$minutes:$seconds $name $msg\n"; + flock(LOG_HANDLE, LOCK_EX); + seek(LOG_HANDLE, 0, 2); print LOG_HANDLE $log_msg; + flock(LOG_HANDLE, LOCK_UN); if( $foreground ) { print STDERR $log_msg; } -- 2.30.2