summaryrefslogtreecommitdiff
path: root/serverloop.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-04-20 07:42:21 +1000
committerDamien Miller <djm@mindrot.org>2000-04-20 07:42:21 +1000
commit166fca8894807de71b741a779330bd23edfec013 (patch)
tree387371567ce5b3c89c52e18f3a22348f1456af8d /serverloop.c
parent3ef692aa05a4b0d94a114be0826d32d0c8f67f1b (diff)
- Sync with OpenBSD CVS:
[clientloop.c login.c serverloop.c ssh-agent.c ssh.h sshconnect.c sshd.c] - pid_t [session.c] - remove bogus chan_read_failed. this could cause data corruption (missing data) at end of a SSH2 session.
Diffstat (limited to 'serverloop.c')
-rw-r--r--serverloop.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/serverloop.c b/serverloop.c
index a7abbe404..1a76b8da8 100644
--- a/serverloop.c
+++ b/serverloop.c
@@ -52,7 +52,7 @@ static int max_fd; /* Max file descriptor number for select(). */
52 * that the child's output gets a chance to drain before it is yanked. 52 * that the child's output gets a chance to drain before it is yanked.
53 */ 53 */
54 54
55static int child_pid; /* Pid of the child. */ 55static pid_t child_pid; /* Pid of the child. */
56static volatile int child_terminated; /* The child has terminated. */ 56static volatile int child_terminated; /* The child has terminated. */
57static volatile int child_has_selected; /* Child has had chance to drain. */ 57static volatile int child_has_selected; /* Child has had chance to drain. */
58static volatile int child_wait_status; /* Status from wait(). */ 58static volatile int child_wait_status; /* Status from wait(). */
@@ -63,7 +63,8 @@ void
63sigchld_handler(int sig) 63sigchld_handler(int sig)
64{ 64{
65 int save_errno = errno; 65 int save_errno = errno;
66 int wait_pid; 66 pid_t wait_pid;
67
67 debug("Received SIGCHLD."); 68 debug("Received SIGCHLD.");
68 wait_pid = wait((int *) &child_wait_status); 69 wait_pid = wait((int *) &child_wait_status);
69 if (wait_pid != -1) { 70 if (wait_pid != -1) {
@@ -373,9 +374,10 @@ process_buffered_input_packets()
373 * child program). 374 * child program).
374 */ 375 */
375void 376void
376server_loop(int pid, int fdin_arg, int fdout_arg, int fderr_arg) 377server_loop(pid_t pid, int fdin_arg, int fdout_arg, int fderr_arg)
377{ 378{
378 int wait_status, wait_pid; /* Status and pid returned by wait(). */ 379 int wait_status; /* Status returned by wait(). */
380 pid_t wait_pid; /* pid returned by wait(). */
379 int waiting_termination = 0; /* Have displayed waiting close message. */ 381 int waiting_termination = 0; /* Have displayed waiting close message. */
380 unsigned int max_time_milliseconds; 382 unsigned int max_time_milliseconds;
381 unsigned int previous_stdout_buffer_bytes; 383 unsigned int previous_stdout_buffer_bytes;