]> git.ipfire.org Git - people/stevee/guardian.git/blobdiff - guardian
Allow including additional ignore files.
[people/stevee/guardian.git] / guardian
index 9b571145c57b83812db4144c81bcf26ad320262f..3e6128f955d75c9bb81a3236801b22775e5e1bbc 100644 (file)
--- a/guardian
+++ b/guardian
@@ -247,17 +247,24 @@ sub Worker ($) {
                        close(FILE);
 
                        # Send filename and message to the parser,
-                       # which will return if an action has to be performed.
-                       my $action = &Guardian::Parser::Parser("$parser", @message);
+                       # which will return if any actions have to be performed.
+                       my @actions = &Guardian::Parser::Parser("$parser", @message);
 
                        # Send the action to the main process and put it into
                        # the queue.
-                       if (defined ($action)) {
+                       if (@actions) {
                                # Lock the queue.
                                lock($queue);
 
-                               # Put the required action into the queue.
-                               $queue->enqueue($action);
+                               # Loop through the actions array, and perform
+                               # every single action.
+                               foreach my $action (@actions) {
+                                       # Prevent from enqueuing empty actions.
+                                       if (defined($action)) {
+                                               # Put the required action into the queue.
+                                               $queue->enqueue($action);
+                                       }
+                               }
                        }
                } else {
                        # Sleep for 10ms until the next round of the loop will start.
@@ -279,7 +286,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...");