summaryrefslogtreecommitdiffstats
path: root/usr.sbin/npppctl
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2015-01-19 01:48:57 +0000
committerderaadt <deraadt@openbsd.org>2015-01-19 01:48:57 +0000
commitdbad4650ad35235393a341c80d161513d6691849 (patch)
treeb2bfe830347defa268b383c88f6c5d6f15541359 /usr.sbin/npppctl
parentCMASK went out of scope with the recent <sys/param.h> removal. But oh (diff)
downloadwireguard-openbsd-dbad4650ad35235393a341c80d161513d6691849.tar.xz
wireguard-openbsd-dbad4650ad35235393a341c80d161513d6691849.zip
move to <limits.h> universe
ok yasuoka
Diffstat (limited to 'usr.sbin/npppctl')
-rw-r--r--usr.sbin/npppctl/npppctl.c9
-rw-r--r--usr.sbin/npppctl/parser.c3
2 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/npppctl/npppctl.c b/usr.sbin/npppctl/npppctl.c
index 6f75d825c19..3ee8af9c8c1 100644
--- a/usr.sbin/npppctl/npppctl.c
+++ b/usr.sbin/npppctl/npppctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: npppctl.c,v 1.4 2014/07/22 02:02:59 yasuoka Exp $ */
+/* $OpenBSD: npppctl.c,v 1.5 2015/01/19 01:48:57 deraadt Exp $ */
/*
* Copyright (c) 2012 Internet Initiative Japan Inc.
@@ -15,7 +15,6 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/queue.h>
#include <sys/socket.h>
#include <sys/un.h>
@@ -40,6 +39,8 @@
#include "parser.h"
#include "npppd_ctl.h"
+#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
+
#ifndef nitems
#define nitems(_x) (sizeof(_x) / sizeof(_x[0]))
#endif
@@ -196,7 +197,7 @@ show_clear_session(struct parse_result *result, FILE *out)
"but cannot disconnect only %d sessions because of "
"the implementation limit.",
ppp_id_idx, (int)nitems(ppp_id));
- clear_session(ppp_id, MIN(ppp_id_idx, nitems(ppp_id)),
+ clear_session(ppp_id, MINIMUM(ppp_id_idx, nitems(ppp_id)),
ppp_id_idx, out);
}
}
@@ -343,7 +344,7 @@ clear_session(u_int ppp_id[], int ppp_id_count, int total, FILE *out)
offsetof(struct npppd_disconnect_request, ppp_id[0])) /
sizeof(u_int);
for (i = 0; i < ppp_id_count; i += n) {
- n = MIN(nmax, ppp_id_count - i);
+ n = MINIMUM(nmax, ppp_id_count - i);
req.count = n;
iov[0].iov_base = &req;
iov[0].iov_len = offsetof(
diff --git a/usr.sbin/npppctl/parser.c b/usr.sbin/npppctl/parser.c
index 69e268af5c3..bc0a3d409d3 100644
--- a/usr.sbin/npppctl/parser.c
+++ b/usr.sbin/npppctl/parser.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parser.c,v 1.2 2014/03/22 04:30:31 yasuoka Exp $ */
+/* $OpenBSD: parser.c,v 1.3 2015/01/19 01:48:57 deraadt Exp $ */
/* This file is derived from OpenBSD:src/usr.sbin/ikectl/parser.c 1.9 */
/*
@@ -19,7 +19,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>