Code

Merged changeset:13526 from gosa-lhm.
authorjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 11 Mar 2009 12:45:11 +0000 (12:45 +0000)
committerjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 11 Mar 2009 12:45:11 +0000 (12:45 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13527 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-si/gosa-si-server

index 8043358cc1c25082903f00971639b0754a96b1ab..2b0c4c1a4b58ed042d8c7e41e44b6b2e01d87b86 100755 (executable)
@@ -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;
@@ -350,7 +350,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;
             }