summaryrefslogtreecommitdiff
path: root/clientloop.c
diff options
context:
space:
mode:
authorderaadt@openbsd.org <deraadt@openbsd.org>2016-09-12 01:22:38 +0000
committerDarren Tucker <dtucker@zip.com.au>2016-09-12 13:46:29 +1000
commit9136ec134c97a8aff2917760c03134f52945ff3c (patch)
treebfcab357e6e0f510d9b63bac43b18097e89fa58a /clientloop.c
parentf219fc8f03caca7ac82a38ed74bbd6432a1195e7 (diff)
upstream commit
Add MAXIMUM(), MINIMUM(), and ROUNDUP() to misc.h, then use those definitions rather than pulling <sys/param.h> and unknown namespace pollution. ok djm markus dtucker Upstream-ID: 712cafa816c9f012a61628b66b9fbd5687223fb8
Diffstat (limited to 'clientloop.c')
-rw-r--r--clientloop.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/clientloop.c b/clientloop.c
index 2c44f5d19..47098f3af 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: clientloop.c,v 1.286 2016/07/23 02:54:08 djm Exp $ */ 1/* $OpenBSD: clientloop.c,v 1.287 2016/09/12 01:22:38 deraadt Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -61,7 +61,6 @@
61 61
62#include "includes.h" 62#include "includes.h"
63 63
64#include <sys/param.h> /* MIN MAX */
65#include <sys/types.h> 64#include <sys/types.h>
66#include <sys/ioctl.h> 65#include <sys/ioctl.h>
67#ifdef HAVE_SYS_STAT_H 66#ifdef HAVE_SYS_STAT_H
@@ -672,16 +671,16 @@ client_wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp,
672 server_alive_time = now + options.server_alive_interval; 671 server_alive_time = now + options.server_alive_interval;
673 } 672 }
674 if (options.rekey_interval > 0 && compat20 && !rekeying) 673 if (options.rekey_interval > 0 && compat20 && !rekeying)
675 timeout_secs = MIN(timeout_secs, packet_get_rekey_timeout()); 674 timeout_secs = MINIMUM(timeout_secs, packet_get_rekey_timeout());
676 set_control_persist_exit_time(); 675 set_control_persist_exit_time();
677 if (control_persist_exit_time > 0) { 676 if (control_persist_exit_time > 0) {
678 timeout_secs = MIN(timeout_secs, 677 timeout_secs = MINIMUM(timeout_secs,
679 control_persist_exit_time - now); 678 control_persist_exit_time - now);
680 if (timeout_secs < 0) 679 if (timeout_secs < 0)
681 timeout_secs = 0; 680 timeout_secs = 0;
682 } 681 }
683 if (minwait_secs != 0) 682 if (minwait_secs != 0)
684 timeout_secs = MIN(timeout_secs, (int)minwait_secs); 683 timeout_secs = MINIMUM(timeout_secs, (int)minwait_secs);
685 if (timeout_secs == INT_MAX) 684 if (timeout_secs == INT_MAX)
686 tvp = NULL; 685 tvp = NULL;
687 else { 686 else {
@@ -1553,7 +1552,7 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id)
1553 buffer_high = 64 * 1024; 1552 buffer_high = 64 * 1024;
1554 connection_in = packet_get_connection_in(); 1553 connection_in = packet_get_connection_in();
1555 connection_out = packet_get_connection_out(); 1554 connection_out = packet_get_connection_out();
1556 max_fd = MAX(connection_in, connection_out); 1555 max_fd = MAXIMUM(connection_in, connection_out);
1557 1556
1558 if (!compat20) { 1557 if (!compat20) {
1559 /* enable nonblocking unless tty */ 1558 /* enable nonblocking unless tty */
@@ -1563,9 +1562,9 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id)
1563 set_nonblock(fileno(stdout)); 1562 set_nonblock(fileno(stdout));
1564 if (!isatty(fileno(stderr))) 1563 if (!isatty(fileno(stderr)))
1565 set_nonblock(fileno(stderr)); 1564 set_nonblock(fileno(stderr));
1566 max_fd = MAX(max_fd, fileno(stdin)); 1565 max_fd = MAXIMUM(max_fd, fileno(stdin));
1567 max_fd = MAX(max_fd, fileno(stdout)); 1566 max_fd = MAXIMUM(max_fd, fileno(stdout));
1568 max_fd = MAX(max_fd, fileno(stderr)); 1567 max_fd = MAXIMUM(max_fd, fileno(stderr));
1569 } 1568 }
1570 quit_pending = 0; 1569 quit_pending = 0;
1571 escape_char1 = escape_char_arg; 1570 escape_char1 = escape_char_arg;