--- ./syslog.c	Sat Feb 17 21:02:50 1996
+++ /usr/src/sysklogd-1.3/syslog.c	Mon May 25 10:41:09 1998
@@ -46,6 +46,7 @@
  *
  */
 
+#include <stddef.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/file.h>
@@ -94,6 +95,8 @@
 	register int cnt;
 	register char *p;
 	time_t now;
+	int ret;
+	int tries=2;
 	int fd, saved_errno;
 	char tbuf[2048], fmt_cpy[1024], *stdp = (char *) 0;
 
@@ -163,8 +166,17 @@
 		(void)writev(2, iov, 2);
 	}
 
-	/* output the message to the local logger */
-	if (write(LogFile, tbuf, cnt + 1) >= 0 || !(LogStat&LOG_CONS))
+	ret=0;
+	while (tries) {
+		/* output the message to the local logger */
+		ret=write(LogFile, tbuf, cnt + 1);
+		if (ret>=0)
+			break;
+		closelog();
+		openlog(LogTag, LogStat | LOG_NDELAY, 0);
+		tries--;
+	}
+	if (ret >= 0 || !(LogStat&LOG_CONS))
 		return;
 
 	/*
