aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Whitley <markw@lineo.com>2001-03-12 19:51:09 +0000
committerMark Whitley <markw@lineo.com>2001-03-12 19:51:09 +0000
commit1a49fc5e92e2b6478f46b0e22edd6079b75dc30e (patch)
treef49e78ff8f1f2d1ddf4828e75b2d5053ea677620
parentfe4e13fb972aef69e1d041b726ebecdf000e91ee (diff)
downloadbusybox-w32-1a49fc5e92e2b6478f46b0e22edd6079b75dc30e.tar.gz
busybox-w32-1a49fc5e92e2b6478f46b0e22edd6079b75dc30e.tar.bz2
busybox-w32-1a49fc5e92e2b6478f46b0e22edd6079b75dc30e.zip
Applied patch from Gennady Feldman to use single-thread instead of forking.
-rw-r--r--sysklogd/syslogd.c32
-rw-r--r--syslogd.c32
2 files changed, 24 insertions, 40 deletions
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
index 8049fc5d1..1276201c3 100644
--- a/sysklogd/syslogd.c
+++ b/sysklogd/syslogd.c
@@ -362,32 +362,24 @@ static void doSyslogd (void)
362 --n_ready; 362 --n_ready;
363 363
364 if (fd == sock_fd) { 364 if (fd == sock_fd) {
365
366 int conn; 365 int conn;
367 pid_t pid;
368 366
367 //printf("New Connection request.\n");
369 if ((conn = accept (sock_fd, (struct sockaddr *) &sunx, &addrLength)) < 0) { 368 if ((conn = accept (sock_fd, (struct sockaddr *) &sunx, &addrLength)) < 0) {
370 perror_msg_and_die ("accept error"); 369 perror_msg_and_die ("accept error");
371 } 370 }
372 371
373 pid = fork(); 372 FD_SET(conn, &fds);
374 373 //printf("conn: %i, set_size: %i\n",conn,FD_SETSIZE);
375 if (pid < 0) { 374 } else {
376 perror ("syslogd: fork"); 375 //printf("Serving connection: %i\n",fd);
377 close (conn); 376 serveConnection (fd);
378 continue; 377 close (fd);
379 } 378 FD_CLR(fd, &fds);
380 379 } /* fd == sock_fd */
381 if (pid == 0) { 380 }/* FD_ISSET() */
382 serveConnection (conn); 381 }/* for */
383 close (conn); 382 } /* for main loop */
384 exit( TRUE);
385 }
386 close (conn);
387 }
388 }
389 }
390 }
391} 383}
392 384
393#ifdef BB_FEATURE_KLOGD 385#ifdef BB_FEATURE_KLOGD
diff --git a/syslogd.c b/syslogd.c
index 8049fc5d1..1276201c3 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -362,32 +362,24 @@ static void doSyslogd (void)
362 --n_ready; 362 --n_ready;
363 363
364 if (fd == sock_fd) { 364 if (fd == sock_fd) {
365
366 int conn; 365 int conn;
367 pid_t pid;
368 366
367 //printf("New Connection request.\n");
369 if ((conn = accept (sock_fd, (struct sockaddr *) &sunx, &addrLength)) < 0) { 368 if ((conn = accept (sock_fd, (struct sockaddr *) &sunx, &addrLength)) < 0) {
370 perror_msg_and_die ("accept error"); 369 perror_msg_and_die ("accept error");
371 } 370 }
372 371
373 pid = fork(); 372 FD_SET(conn, &fds);
374 373 //printf("conn: %i, set_size: %i\n",conn,FD_SETSIZE);
375 if (pid < 0) { 374 } else {
376 perror ("syslogd: fork"); 375 //printf("Serving connection: %i\n",fd);
377 close (conn); 376 serveConnection (fd);
378 continue; 377 close (fd);
379 } 378 FD_CLR(fd, &fds);
380 379 } /* fd == sock_fd */
381 if (pid == 0) { 380 }/* FD_ISSET() */
382 serveConnection (conn); 381 }/* for */
383 close (conn); 382 } /* for main loop */
384 exit( TRUE);
385 }
386 close (conn);
387 }
388 }
389 }
390 }
391} 383}
392 384
393#ifdef BB_FEATURE_KLOGD 385#ifdef BB_FEATURE_KLOGD