Applied patch from Gennady Feldman to use single-thread instead of forking.
This commit is contained in:
parent
fe4e13fb97
commit
1a49fc5e92
@ -362,32 +362,24 @@ static void doSyslogd (void)
|
|||||||
--n_ready;
|
--n_ready;
|
||||||
|
|
||||||
if (fd == sock_fd) {
|
if (fd == sock_fd) {
|
||||||
|
|
||||||
int conn;
|
int conn;
|
||||||
pid_t pid;
|
|
||||||
|
|
||||||
|
//printf("New Connection request.\n");
|
||||||
if ((conn = accept (sock_fd, (struct sockaddr *) &sunx, &addrLength)) < 0) {
|
if ((conn = accept (sock_fd, (struct sockaddr *) &sunx, &addrLength)) < 0) {
|
||||||
perror_msg_and_die ("accept error");
|
perror_msg_and_die ("accept error");
|
||||||
}
|
}
|
||||||
|
|
||||||
pid = fork();
|
FD_SET(conn, &fds);
|
||||||
|
//printf("conn: %i, set_size: %i\n",conn,FD_SETSIZE);
|
||||||
if (pid < 0) {
|
} else {
|
||||||
perror ("syslogd: fork");
|
//printf("Serving connection: %i\n",fd);
|
||||||
close (conn);
|
serveConnection (fd);
|
||||||
continue;
|
close (fd);
|
||||||
}
|
FD_CLR(fd, &fds);
|
||||||
|
} /* fd == sock_fd */
|
||||||
if (pid == 0) {
|
}/* FD_ISSET() */
|
||||||
serveConnection (conn);
|
}/* for */
|
||||||
close (conn);
|
} /* for main loop */
|
||||||
exit( TRUE);
|
|
||||||
}
|
|
||||||
close (conn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef BB_FEATURE_KLOGD
|
#ifdef BB_FEATURE_KLOGD
|
||||||
|
32
syslogd.c
32
syslogd.c
@ -362,32 +362,24 @@ static void doSyslogd (void)
|
|||||||
--n_ready;
|
--n_ready;
|
||||||
|
|
||||||
if (fd == sock_fd) {
|
if (fd == sock_fd) {
|
||||||
|
|
||||||
int conn;
|
int conn;
|
||||||
pid_t pid;
|
|
||||||
|
|
||||||
|
//printf("New Connection request.\n");
|
||||||
if ((conn = accept (sock_fd, (struct sockaddr *) &sunx, &addrLength)) < 0) {
|
if ((conn = accept (sock_fd, (struct sockaddr *) &sunx, &addrLength)) < 0) {
|
||||||
perror_msg_and_die ("accept error");
|
perror_msg_and_die ("accept error");
|
||||||
}
|
}
|
||||||
|
|
||||||
pid = fork();
|
FD_SET(conn, &fds);
|
||||||
|
//printf("conn: %i, set_size: %i\n",conn,FD_SETSIZE);
|
||||||
if (pid < 0) {
|
} else {
|
||||||
perror ("syslogd: fork");
|
//printf("Serving connection: %i\n",fd);
|
||||||
close (conn);
|
serveConnection (fd);
|
||||||
continue;
|
close (fd);
|
||||||
}
|
FD_CLR(fd, &fds);
|
||||||
|
} /* fd == sock_fd */
|
||||||
if (pid == 0) {
|
}/* FD_ISSET() */
|
||||||
serveConnection (conn);
|
}/* for */
|
||||||
close (conn);
|
} /* for main loop */
|
||||||
exit( TRUE);
|
|
||||||
}
|
|
||||||
close (conn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef BB_FEATURE_KLOGD
|
#ifdef BB_FEATURE_KLOGD
|
||||||
|
Loading…
Reference in New Issue
Block a user