[4494] in RedHat Linux List

home help back first fref pref prev next nref lref last post

[PATCH] Syslogd bug: Too many open files

daemon@ATHENA.MIT.EDU (Jos Vos)
Fri Nov 15 07:42:29 1996

To: greg@wind.rmcc.com
Cc: jiivee@hut.fi, shane@ion.apana.org.au, joey@linux.de,
        redhat-list@redhat.com
Date: Fri, 15 Nov 1996 13:38:20 +0100
From: Jos Vos <jos@xos.nl>
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com

Hi,

Always impatient...  because nobody answered my mail within one hour or so,
I decided to solve the problem myself ;-).  Here's a patch for sysklogd 1.3
that solves the problem of the "Too many open files" after sending several
SIGHUP signals.

I'm not sure about any unwanted side effects, so I hope one of the sysklogd
maintainers will look at it more carefully and confirm whether this patch
can be applied without danger.  It seems to work fine for me, at least.

=====================CUT HERE===================
--- syslogd.c.org	Fri Nov 15 13:05:45 1996
+++ syslogd.c	Fri Nov 15 13:10:03 1996
@@ -1847,13 +1847,6 @@
 	 *  Close all open log files.
 	 */
 	Initialized = 0;
-	if ( nlogs > -1 )
-	{
-		dprintf("Initializing log structures.\n");
-		nlogs = -1;
-		free((void *) Files);
-		Files = (struct filed *) 0;
-	}
 	
 #ifdef SYSV
 	for (lognum = 0; lognum <= nlogs; lognum++ ) {
@@ -1882,6 +1875,14 @@
 	Files = NULL;
 	nextp = &OBFiles;
 #endif
+
+	if ( nlogs > -1 )
+	{
+		dprintf("Initializing log structures.\n");
+		nlogs = -1;
+		free((void *) Files);
+		Files = (struct filed *) 0;
+	}
 
 	/* open the configuration file */
 	if ((cf = fopen(ConfFile, "r")) == NULL) {
=====================CUT HERE===================

--
--    Jos Vos <jos@xos.nl>
--    X/OS Experts in Open Systems BV   |   Phone: +31 20 6938364
--    Amsterdam, The Netherlands        |     Fax: +31 20 6948204


--
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
  ________________________________________________________________________
  http://www.redhat.com/RedHat-FAQ   http://www.redhat.com/RedHat-Errata
  http://www.redhat.com/RedHat-Tips  http://www.redhat.com/mailing-lists
  ------------------------------------------------------------------------
To unsubscribe: mail -s unsubscribe redhat-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post