aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2000-12-08 19:41:21 +0000
committerEric Andersen <andersen@codepoet.org>2000-12-08 19:41:21 +0000
commit76fef0a5d02800afa368b79abf4393eda46abc4c (patch)
treeb94c2cabf9b94b51ea77bba17ab879e89b514cc4
parent9cff4fbac91bdd63acbed23b732d76c56177ca62 (diff)
downloadbusybox-76fef0a5d02800afa368b79abf4393eda46abc4c.tar.gz
Patch from Gennady Feldman <gfeldman@mail.com> to make syslogd not log
when compiled for remote logging. Not the ideal way to fix it (it should really be a runtime switch), but good enough for now I guess...
-rw-r--r--Changelog2
-rw-r--r--sysklogd/syslogd.c8
-rw-r--r--syslogd.c8
3 files changed, 10 insertions, 8 deletions
diff --git a/Changelog b/Changelog
index 3095c95cb..5c5be4252 100644
--- a/Changelog
+++ b/Changelog
@@ -46,6 +46,8 @@
* Jim Gleason <jimg@lineo.com> -- fixed tar so it no longer breaks
hard links.
* Matt Kraai -- logger now logs all arguments, not just the first
+ * Gennady Feldman -- syslogd no longer logs to localhost if compiled
+ for remote logging...
-Erik Andersen
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
index d82aa63fd..bb0df8c51 100644
--- a/sysklogd/syslogd.c
+++ b/sysklogd/syslogd.c
@@ -161,9 +161,6 @@ static void logMessage (int pri, char *msg)
/* todo: supress duplicates */
- /* now spew out the message to wherever it is supposed to go */
- message("%s %s %s %s\n", timestamp, LocalHostName, res, msg);
-
#ifdef BB_FEATURE_REMOTE_LOG
/* send message to remote logger */
if ( -1 != remotefd){
@@ -184,8 +181,11 @@ static void logMessage (int pri, char *msg)
error_msg_and_die("syslogd: cannot write to remote file handle on"
"%s:%d\n",RemoteHost,RemotePort);
}
- }
+ } else
#endif
+ /* now spew out the message to wherever it is supposed to go */
+ message("%s %s %s %s\n", timestamp, LocalHostName, res, msg);
+
}
diff --git a/syslogd.c b/syslogd.c
index d82aa63fd..bb0df8c51 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -161,9 +161,6 @@ static void logMessage (int pri, char *msg)
/* todo: supress duplicates */
- /* now spew out the message to wherever it is supposed to go */
- message("%s %s %s %s\n", timestamp, LocalHostName, res, msg);
-
#ifdef BB_FEATURE_REMOTE_LOG
/* send message to remote logger */
if ( -1 != remotefd){
@@ -184,8 +181,11 @@ static void logMessage (int pri, char *msg)
error_msg_and_die("syslogd: cannot write to remote file handle on"
"%s:%d\n",RemoteHost,RemotePort);
}
- }
+ } else
#endif
+ /* now spew out the message to wherever it is supposed to go */
+ message("%s %s %s %s\n", timestamp, LocalHostName, res, msg);
+
}