mirror of https://github.com/mirror/busybox.git
Applied patch from Gennady Feldman to fix a single-threaded syslogd bug that
turned up. This code needs to be tested on an embedded system, since that's where the bug turned up in the first place.1_00_stable_10817
parent
2b549c3be0
commit
bff6b18bf9
|
@ -393,7 +393,9 @@ static int serveConnection (int conn)
|
|||
RESERVE_BB_BUFFER(tmpbuf, BUFSIZE + 1);
|
||||
int n_read;
|
||||
|
||||
while ((n_read = read (conn, tmpbuf, BUFSIZE )) > 0) {
|
||||
n_read = read (conn, tmpbuf, BUFSIZE );
|
||||
|
||||
if (n_read > 0) {
|
||||
|
||||
int pri = (LOG_USER | LOG_NOTICE);
|
||||
char line[ BUFSIZE + 1 ];
|
||||
|
@ -427,7 +429,7 @@ static int serveConnection (int conn)
|
|||
/* Now log it */
|
||||
logMessage (pri, line);
|
||||
}
|
||||
return (0);
|
||||
return n_read;
|
||||
}
|
||||
|
||||
|
||||
|
@ -550,9 +552,10 @@ static void doSyslogd (void)
|
|||
//printf("conn: %i, set_size: %i\n",conn,FD_SETSIZE);
|
||||
} else {
|
||||
//printf("Serving connection: %i\n",fd);
|
||||
serveConnection (fd);
|
||||
if ( serveConnection(fd) <= 0 ) {
|
||||
close (fd);
|
||||
FD_CLR(fd, &fds);
|
||||
}
|
||||
} /* fd == sock_fd */
|
||||
}/* FD_ISSET() */
|
||||
}/* for */
|
||||
|
|
|
@ -393,7 +393,9 @@ static int serveConnection (int conn)
|
|||
RESERVE_BB_BUFFER(tmpbuf, BUFSIZE + 1);
|
||||
int n_read;
|
||||
|
||||
while ((n_read = read (conn, tmpbuf, BUFSIZE )) > 0) {
|
||||
n_read = read (conn, tmpbuf, BUFSIZE );
|
||||
|
||||
if (n_read > 0) {
|
||||
|
||||
int pri = (LOG_USER | LOG_NOTICE);
|
||||
char line[ BUFSIZE + 1 ];
|
||||
|
@ -427,7 +429,7 @@ static int serveConnection (int conn)
|
|||
/* Now log it */
|
||||
logMessage (pri, line);
|
||||
}
|
||||
return (0);
|
||||
return n_read;
|
||||
}
|
||||
|
||||
|
||||
|
@ -550,9 +552,10 @@ static void doSyslogd (void)
|
|||
//printf("conn: %i, set_size: %i\n",conn,FD_SETSIZE);
|
||||
} else {
|
||||
//printf("Serving connection: %i\n",fd);
|
||||
serveConnection (fd);
|
||||
if ( serveConnection(fd) <= 0 ) {
|
||||
close (fd);
|
||||
FD_CLR(fd, &fds);
|
||||
}
|
||||
} /* fd == sock_fd */
|
||||
}/* FD_ISSET() */
|
||||
}/* for */
|
||||
|
|
Loading…
Reference in New Issue