[BusyBox] syslogd question

Nick Fedchik fnm at fusion.ukrsat.com
Sat Jan 25 03:37:03 UTC 2003


Hi ALL!

Can anybody tell me, why busybox syslogd must die when it can't
sent packets to another remote syslogd? Or if remote syslogd
unable to receive packets from busybox syslogd?

Details in the attached patch.

-- 
Nick Fedchik, FNM3-RIPE(UANIC)
Internet Dept./ISP UkrSat, Kiev, Ukraine
-------------- next part --------------
--- busybox/sysklogd/syslogd.c	2002-12-12 12:54:48 +0200
+++ busybox-dirty/sysklogd/syslogd.c	2003-01-25 12:31:43 +0200
@@ -226,9 +226,9 @@ void circ_message(const char *msg)
 				int k = buf->tail + l - buf->head;	/* we need to know how many bytes
 													   we are overwriting to make
 													   enough room */
-				char *c =
-					memchr(buf->data + buf->head + k, '\0',
-						   buf->size - (buf->head + k));
+				char *c = memchr(buf->data + buf->head + k, '\0',
+								 buf->size - (buf->head + k));
+
 				if (c != NULL) {	/* do a sanity check just in case! */
 					buf->head = c - buf->data + 1;	/* we need to convert pointer to
 													   offset + skip the '\0' since
@@ -390,11 +390,17 @@ static void logMessage(int pri, char *ms
 			if (errno == EINTR) {
 				goto writev_retry;
 			}
+/*
 			error_msg_and_die("cannot write to remote file handle on %s:%d",
 							  RemoteHost, RemotePort);
+*/
+			if (local_logging)
+				message("%s %s %s Unable to send log to %s:%d (%s)\n",
+						timestamp, LocalHostName, res, RemoteHost, RemotePort,
+						strerror(errno));
 		}
 	}
-	if (local_logging == TRUE)
+	if (local_logging)
 #endif
 		/* now spew out the message to wherever it is supposed to go */
 		message("%s %s %s %s\n", timestamp, LocalHostName, res, msg);


More information about the busybox mailing list