diff options
author | deraadt@openbsd.org <deraadt@openbsd.org> | 2016-09-12 01:22:38 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2016-09-12 13:46:29 +1000 |
commit | 9136ec134c97a8aff2917760c03134f52945ff3c (patch) | |
tree | bfcab357e6e0f510d9b63bac43b18097e89fa58a /sftp-client.c | |
parent | f219fc8f03caca7ac82a38ed74bbd6432a1195e7 (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 'sftp-client.c')
-rw-r--r-- | sftp-client.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sftp-client.c b/sftp-client.c index 0ca44a4d6..e65c15c8f 100644 --- a/sftp-client.c +++ b/sftp-client.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sftp-client.c,v 1.124 2016/05/25 23:48:45 schwarze Exp $ */ | 1 | /* $OpenBSD: sftp-client.c,v 1.125 2016/09/12 01:22:38 deraadt Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> | 3 | * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> |
4 | * | 4 | * |
@@ -22,7 +22,6 @@ | |||
22 | 22 | ||
23 | #include "includes.h" | 23 | #include "includes.h" |
24 | 24 | ||
25 | #include <sys/param.h> /* MIN MAX */ | ||
26 | #include <sys/types.h> | 25 | #include <sys/types.h> |
27 | #ifdef HAVE_SYS_STATVFS_H | 26 | #ifdef HAVE_SYS_STATVFS_H |
28 | #include <sys/statvfs.h> | 27 | #include <sys/statvfs.h> |
@@ -462,7 +461,7 @@ do_init(int fd_in, int fd_out, u_int transfer_buflen, u_int num_requests, | |||
462 | 461 | ||
463 | /* Some filexfer v.0 servers don't support large packets */ | 462 | /* Some filexfer v.0 servers don't support large packets */ |
464 | if (ret->version == 0) | 463 | if (ret->version == 0) |
465 | ret->transfer_buflen = MIN(ret->transfer_buflen, 20480); | 464 | ret->transfer_buflen = MINIMUM(ret->transfer_buflen, 20480); |
466 | 465 | ||
467 | ret->limit_kbps = limit_kbps; | 466 | ret->limit_kbps = limit_kbps; |
468 | if (ret->limit_kbps > 0) { | 467 | if (ret->limit_kbps > 0) { |
@@ -1351,7 +1350,7 @@ do_download(struct sftp_conn *conn, const char *remote_path, | |||
1351 | req->offset, req->len, handle, handle_len); | 1350 | req->offset, req->len, handle, handle_len); |
1352 | /* Reduce the request size */ | 1351 | /* Reduce the request size */ |
1353 | if (len < buflen) | 1352 | if (len < buflen) |
1354 | buflen = MAX(MIN_READ_SIZE, len); | 1353 | buflen = MAXIMUM(MIN_READ_SIZE, len); |
1355 | } | 1354 | } |
1356 | if (max_req > 0) { /* max_req = 0 iff EOF received */ | 1355 | if (max_req > 0) { /* max_req = 0 iff EOF received */ |
1357 | if (size > 0 && offset > size) { | 1356 | if (size > 0 && offset > size) { |