[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#5254: found part of the bug



Hi,

I found an part of the problem, the selet fails cause of:

--- /usr/src/sysklogd-1.3orig/syslogd.c	Mon Aug  5 22:47:34 1996
+++ /usr/src/sysklogd-1.3/syslogd.c	Mon Nov  4 19:28:36 1996
@@ -845,7 +845,11 @@
 		 * Add the Unix Domain Socket to the list of read
 		 * descriptors.
 		 */
-		FD_SET(funix, &readfds);
+		if (funix >= 0)
+			FD_SET(funix, &readfds);
+		else
+		                logerror("funix<=0");
+		                
 		for (nfds= 0; nfds < FD_SETSIZE; ++nfds)
 			if ( FD_ISSET(nfds, &unixm) )
 				FD_SET(nfds, &readfds);
@@ -933,7 +937,7 @@
 		  	}
 	      	}
 		/* Accept a new unix connection */
-		if (FD_ISSET(funix, &readfds)) {
+		if ((funix >= 0) && FD_ISSET(funix, &readfds)) {
 			len = sizeof(fromunix);
 			if ((fd = accept(funix, (struct sockaddr *) &fromunix,\
 					 &len)) >= 0) {
@@ -1849,8 +1853,8 @@
 	}
 
 	/* Close the sockets. */
-        close(funix);
-	close(inetm);
+        if (funix >= 0) close(funix);
+	if (inetm >= 0) close(inetm);
 
 	/* Clean-up files. */
 	(void) unlink(LogName);

But I fail to see WHY funix is <= 0. And I can't reproduce the error. :( At
least this patch won't hurt anyway (especially if SYSV is defined and the
daemon wont die().)

Greetings
Bernd
-- 
  (OO)      -- Bernd_Eckenfels@Wittumstrasse13.76646Bruchsal.de --
 ( .. )   ecki@{lina.inka.de,linux.de}  http://home.pages.de/~eckes/
  o--o     *plush*  2048/A2C51749  eckes@irc  +4972573817  *plush*
(O____O)       If privacy is outlawed only Outlaws have privacy

--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-REQUEST@lists.debian.org . Trouble? e-mail to Bruce@Pixar.com


Reply to: