]> git.ipfire.org Git - people/stevee/guardian.git/blobdiff - guardian
Add LogFacility for logging to a single file.
[people/stevee/guardian.git] / guardian
index 7b4c23fae7b86c7e2d5b1ea7a726a23b03baf2f9..148f50e38e9f2b166336c16642087965e0c02be6 100644 (file)
--- a/guardian
+++ b/guardian
@@ -248,16 +248,16 @@ sub Worker ($) {
 
                        # Send filename and message to the parser,
                        # which will return if an action has to be performed.
-                       my @action = &Guardian::Parser::Parser("$parser", @message);
+                       my $action = &Guardian::Parser::Parser("$parser", @message);
 
                        # Send the action to the main process and put it into
                        # the queue.
-                       if (@action) {
+                       if (defined ($action)) {
                                # Lock the queue.
                                lock($queue);
 
                                # Put the required action into the queue.
-                               $queue->enqueue(@action);
+                               $queue->enqueue($action);
                        }
                } else {
                        # Sleep for 10ms until the next round of the loop will start.
@@ -279,7 +279,7 @@ sub Worker ($) {
 #
 sub Socket () {
        # Create the Server socket by calling the responsible function.
-       my $server = &Guardian::Socket::Server();
+       my $server = &Guardian::Socket::Server($mainsettings{SocketOwner});
 
        # Log successfull creation of socket.
        $logger->Log("debug", "Listening to Socket...");
@@ -387,8 +387,10 @@ sub Reload () {
        # Update logger object in mainsettings hash.
        $mainsettings{Logger} = $logger;
 
-       # Update ignore list.
-       &Guardian::Events::GenerateIgnoreList($mainsettings{IgnoreFile});
+       # Update ignore list, if one has been specified.
+       if (exists($mainsettings{IgnoreFile})) {
+               &Guardian::Events::GenerateIgnoreList($mainsettings{IgnoreFile});
+       }
 
        # Re-generate hash of monitored files.
        %monitored_files = &Guardian::Base::GenerateMonitoredFiles(\%mainsettings, \%monitored_files);