]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
Fix build of syslogdctrl.
authorArne Fitzenreiter <arne_f@ipfire.org>
Thu, 18 Mar 2010 06:59:24 +0000 (07:59 +0100)
committerArne Fitzenreiter <arne_f@ipfire.org>
Thu, 18 Mar 2010 06:59:24 +0000 (07:59 +0100)
src/misc-progs/syslogdctrl.c

index 0e10e160b5379599b2bb08f6eaa1377e89fdd416..a470e47edbf50a61eb54d2348ebd8c1a72b739b3 100644 (file)
@@ -30,7 +30,8 @@
 
 int main(void)
 {
 
 int main(void)
 {
-   char buffer[STRING_SIZE], command[STRING_SIZE], hostname[STRING_SIZE], varmessages[STRING_SIZE];
+   char buffer[STRING_SIZE], command[STRING_SIZE], hostname[STRING_SIZE];
+   char varmessages[STRING_SIZE], enable_asynclog[STRING_SIZE];
    int config_fd,rc,fd,pid;
    struct stat st;
    struct keyvalue *kv = NULL;
    int config_fd,rc,fd,pid;
    struct stat st;
    struct keyvalue *kv = NULL;
@@ -62,6 +63,13 @@ int main(void)
       fprintf(stderr, "Cannot read REMOTELOG_ADDR\n");
       exit(ERR_SETTINGS);
    }
       fprintf(stderr, "Cannot read REMOTELOG_ADDR\n");
       exit(ERR_SETTINGS);
    }
+
+   if (!findkey(kv, "ENABLE_ASYNCLOG", enable_asynclog))
+   {
+      fprintf(stderr, "Cannot read ENABLE_ASYNCLOG\n");
+      exit(ERR_SETTINGS);
+   }
+
    
    if (!findkey(kv, "VARMESSAGES", varmessages))
    {
    
    if (!findkey(kv, "VARMESSAGES", varmessages))
    {
@@ -125,7 +133,7 @@ int main(void)
    /* Replace the logging option*/
      safe_system("grep -v '/var/log/messages' < /etc/syslog.conf.new > /etc/syslog.conf.tmp && mv /etc/syslog.conf.tmp /etc/syslog.conf.new");
    
    /* Replace the logging option*/
      safe_system("grep -v '/var/log/messages' < /etc/syslog.conf.new > /etc/syslog.conf.tmp && mv /etc/syslog.conf.tmp /etc/syslog.conf.new");
    
-   if (strcmp(ENABLE_ASYNCLOG,"on"))
+   if (strcmp(enable_asynclog,"on"))
      snprintf(command, STRING_SIZE-1, "printf '%s     -/var/log/messages' >> /etc/syslog.conf.new", varmessages );
    else
      snprintf(command, STRING_SIZE-1, "printf '%s     /var/log/messages' >> /etc/syslog.conf.new", varmessages );
      snprintf(command, STRING_SIZE-1, "printf '%s     -/var/log/messages' >> /etc/syslog.conf.new", varmessages );
    else
      snprintf(command, STRING_SIZE-1, "printf '%s     /var/log/messages' >> /etc/syslog.conf.new", varmessages );