syslogd: small fix to config patch
authorSergey Naumov <sknaumov@gmail.com>
Sat, 16 Apr 2011 17:36:15 +0000 (19:36 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sat, 16 Apr 2011 17:36:15 +0000 (19:36 +0200)
Signed-off-by: Sergey Naumov <sknaumov@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
sysklogd/syslogd.c

index 7ddd3e4c3661bdf7f2b9c489327813450e504c13..0799038e94439f4f03bedd17ba17c694d1e36cb3 100644 (file)
@@ -385,9 +385,15 @@ static void parse_syslogdcfg(const char *file)
                        cur_selector = next_selector;
                } while (cur_selector);
 
-               /* check whether current file name was mentioned in previous rules.
-                * temporarily use cur_rule as iterator, but *pp_rule still points to
-                * currently processing rule entry.
+               /* check whether current file name was mentioned in previous rules or
+                * as global logfile (G.logFile).
+                */
+               if (strcmp(G.logFile.path, tok[1]) == 0) {
+                       cur_rule->file = &G.logFile;
+                       goto found;
+               }
+               /* temporarily use cur_rule as iterator, but *pp_rule still points
+                * to currently processing rule entry.
                 * NOTE: *pp_rule points to the current (and last in the list) rule.
                 */
                for (cur_rule = G.log_rules; cur_rule != *pp_rule; cur_rule = cur_rule->next) {