-/* $OpenBSD: bootstrap.c,v 1.5 2014/06/25 18:23:02 tobias Exp $ */
+/* $OpenBSD: bootstrap.c,v 1.6 2015/01/16 00:05:12 deraadt Exp $ */
/*
* Copyright (c) 2013 Joel Sing <jsing@openbsd.org>
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
+#include <sys/param.h> /* DEV_BSIZE */
#include <sys/disklabel.h>
#include <sys/dkio.h>
#include <sys/ioctl.h>
-/* $OpenBSD: i386_installboot.c,v 1.6 2014/10/08 04:26:54 deraadt Exp $ */
+/* $OpenBSD: i386_installboot.c,v 1.7 2015/01/16 00:05:12 deraadt Exp $ */
/* $NetBSD: installboot.c,v 1.5 1995/11/17 23:23:50 gwr Exp $ */
/*
#define ELFSIZE 32
-#include <sys/param.h>
+#include <sys/param.h> /* DEV_BSIZE MAXFRAG */
+#include <sys/types.h>
#include <sys/disklabel.h>
#include <sys/dkio.h>
#include <sys/ioctl.h>
-/* $OpenBSD: i386_nlist.c,v 1.1 2014/01/19 02:58:50 jsing Exp $ */
+/* $OpenBSD: i386_nlist.c,v 1.2 2015/01/16 00:05:12 deraadt Exp $ */
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
#define ELFSIZE 32
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <string.h>
#include <unistd.h>
+#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
+
static int __elf_fdnlist(int, struct nlist *);
static int __elf_is_okay__(Elf_Ehdr *ehdr);
goto elf_done;
while (symsize > 0) {
- cc = MIN(symsize, sizeof(sbuf));
+ cc = MINIMUM(symsize, sizeof(sbuf));
if (pread(fd, sbuf, cc, (off_t)symoff) != cc)
break;
symsize -= cc;
-/* $OpenBSD: i386_softraid.c,v 1.2 2014/06/09 13:13:48 jsing Exp $ */
+/* $OpenBSD: i386_softraid.c,v 1.3 2015/01/16 00:05:12 deraadt Exp $ */
/*
* Copyright (c) 2012 Joel Sing <jsing@openbsd.org>
*
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
+#include <sys/param.h> /* DEV_BSIZE */
+#include <sys/types.h>
#include <sys/disklabel.h>
#include <sys/dkio.h>
#include <sys/ioctl.h>
-/* $OpenBSD: softraid.c,v 1.2 2013/12/28 11:26:57 jsing Exp $ */
+/* $OpenBSD: softraid.c,v 1.3 2015/01/16 00:05:12 deraadt Exp $ */
/*
* Copyright (c) 2012 Joel Sing <jsing@openbsd.org>
*
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/dkio.h>
#include <sys/ioctl.h>
-/* $OpenBSD: sparc64_installboot.c,v 1.2 2014/06/09 13:13:48 jsing Exp $ */
+/* $OpenBSD: sparc64_installboot.c,v 1.3 2015/01/16 00:05:12 deraadt Exp $ */
/*
* Copyright (c) 2012, 2013 Joel Sing <jsing@openbsd.org>
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
+#include <sys/param.h> /* DEV_BSIZE */
#include <sys/stat.h>
#include <err.h>
-/* $OpenBSD: sparc64_softraid.c,v 1.1 2014/01/19 02:58:50 jsing Exp $ */
+/* $OpenBSD: sparc64_softraid.c,v 1.2 2015/01/16 00:05:12 deraadt Exp $ */
/*
* Copyright (c) 2012 Joel Sing <jsing@openbsd.org>
*
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
+#include <sys/types.h>
#include <sys/disklabel.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
-/* $OpenBSD: util.c,v 1.4 2014/06/09 15:50:08 jsing Exp $ */
+/* $OpenBSD: util.c,v 1.5 2015/01/16 00:05:12 deraadt Exp $ */
/*
* Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/stat.h>
#include <err.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
#include "installboot.h"
+#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
+
#define BUFSIZE 512
void
err(1, "chmod");
while (sz > 0) {
- n = MIN(sz, BUFSIZE);
+ n = MINIMUM(sz, BUFSIZE);
if ((n = read(sfd, buf, n)) == -1)
err(1, "read");
sz -= n;
-/* $OpenBSD: ber.c,v 1.27 2014/04/25 06:57:11 blambert Exp $ */
+/* $OpenBSD: ber.c,v 1.28 2015/01/16 00:05:13 deraadt Exp $ */
/*
* Copyright (c) 2007, 2012 Reyk Floeter <reyk@openbsd.org>
*/
#include <sys/types.h>
-#include <sys/param.h>
#include <errno.h>
#include <limits.h>
#include "ber.h"
+#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
#define BER_TYPE_CONSTRUCTED 0x20 /* otherwise primitive */
#define BER_TYPE_SINGLE_MAX 30
return -1;
sz = b->br_rend - b->br_rptr;
- len = MIN(nbytes, sz);
+ len = MINIMUM(nbytes, sz);
if (len == 0) {
errno = ECANCELED;
return (-1); /* end of buffer and parser wants more data */
-/* $OpenBSD: control.c,v 1.27 2014/11/19 10:19:00 blambert Exp $ */
+/* $OpenBSD: control.c,v 1.28 2015/01/16 00:05:13 deraadt Exp $ */
/*
* Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
*/
#include <sys/queue.h>
-#include <sys/param.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/un.h>
-/* $OpenBSD: kroute.c,v 1.29 2014/10/16 04:05:02 deraadt Exp $ */
+/* $OpenBSD: kroute.c,v 1.30 2015/01/16 00:05:13 deraadt Exp $ */
/*
* Copyright (c) 2007, 2008 Reyk Floeter <reyk@openbsd.org>
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
-/* $OpenBSD: log.c,v 1.5 2014/10/25 03:23:49 lteo Exp $ */
+/* $OpenBSD: log.c,v 1.6 2015/01/16 00:05:13 deraadt Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
*/
#include <sys/types.h>
-#include <sys/param.h>
#include <sys/queue.h>
#include <sys/socket.h>
#include <sys/tree.h>
-/* $OpenBSD: mib.c,v 1.73 2014/11/18 20:54:29 krw Exp $ */
+/* $OpenBSD: mib.c,v 1.74 2015/01/16 00:05:13 deraadt Exp $ */
/*
* Copyright (c) 2012 Joel Knight <joel@openbsd.org>
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include <sys/param.h> /* MAXCOMLEN */
#include <sys/queue.h>
-#include <sys/param.h>
#include <sys/proc.h>
-#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/un.h>
-/* $OpenBSD: mps.c,v 1.19 2014/11/19 10:19:00 blambert Exp $ */
+/* $OpenBSD: mps.c,v 1.20 2015/01/16 00:05:13 deraadt Exp $ */
/*
* Copyright (c) 2007, 2008, 2012 Reyk Floeter <reyk@openbsd.org>
*/
#include <sys/queue.h>
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
-/* $OpenBSD: pf.c,v 1.7 2014/10/08 05:24:42 deraadt Exp $ */
+/* $OpenBSD: pf.c,v 1.8 2015/01/16 00:05:13 deraadt Exp $ */
/*
* Copyright (c) 2012 Joel Knight <joel@openbsd.org>
*
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
#include <event.h>
#include "snmpd.h"
-/* $OpenBSD: smi.c,v 1.16 2014/11/19 10:19:00 blambert Exp $ */
+
/*
* Copyright (c) 2007, 2008 Reyk Floeter <reyk@openbsd.org>
*/
#include <sys/queue.h>
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
#include <pwd.h>
#include <vis.h>
#include "snmpd.h"
#include "mib.h"
+#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
+
extern struct snmpd *env;
RB_HEAD(oidtree, oid);
{
size_t i;
- for (i = 0; i < MIN(a->o_oidlen, b->o_oidlen); i++)
+ for (i = 0; i < MINIMUM(a->o_oidlen, b->o_oidlen); i++)
if (a->o_oid[i] != b->o_oid[i])
return (a->o_oid[i] - b->o_oid[i]);
-/* $OpenBSD: snmpd.c,v 1.24 2014/08/18 13:13:42 reyk Exp $ */
+/* $OpenBSD: snmpd.c,v 1.25 2015/01/16 00:05:13 deraadt Exp $ */
/*
* Copyright (c) 2007, 2008, 2012 Reyk Floeter <reyk@openbsd.org>
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include <sys/param.h> /* nitems */
#include <sys/types.h>
#include <sys/queue.h>
#include <sys/socket.h>
-#include <sys/param.h>
#include <sys/wait.h>
#include <sys/tree.h>
-/* $OpenBSD: snmpd.h,v 1.58 2014/11/19 10:19:00 blambert Exp $ */
+/* $OpenBSD: snmpd.h,v 1.59 2015/01/16 00:05:13 deraadt Exp $ */
/*
* Copyright (c) 2007, 2008, 2012 Reyk Floeter <reyk@openbsd.org>
struct snmp_message {
struct sockaddr_storage sm_ss;
socklen_t sm_slen;
- char sm_host[MAXHOSTNAMELEN];
+ char sm_host[HOST_NAME_MAX+1];
struct ber sm_ber;
struct ber_element *sm_req;
-/* $OpenBSD: snmpe.c,v 1.39 2014/11/19 10:19:00 blambert Exp $ */
+/* $OpenBSD: snmpe.c,v 1.40 2015/01/16 00:05:13 deraadt Exp $ */
/*
* Copyright (c) 2007, 2008, 2012 Reyk Floeter <reyk@openbsd.org>
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include <sys/param.h> /* nitems */
#include <sys/queue.h>
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
-/* $OpenBSD: timer.c,v 1.3 2014/10/25 03:23:49 lteo Exp $ */
+/* $OpenBSD: timer.c,v 1.4 2015/01/16 00:05:13 deraadt Exp $ */
/*
* Copyright (c) 2008 Reyk Floeter <reyk@openbsd.org>
*/
#include <sys/queue.h>
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/sched.h>
#include <sys/socket.h>
-/* $OpenBSD: trap.c,v 1.23 2014/11/19 10:19:00 blambert Exp $ */
+/* $OpenBSD: trap.c,v 1.24 2015/01/16 00:05:13 deraadt Exp $ */
/*
* Copyright (c) 2008 Reyk Floeter <reyk@openbsd.org>
*/
#include <sys/queue.h>
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
-/* $OpenBSD: traphandler.c,v 1.1 2014/04/25 06:57:11 blambert Exp $ */
+/* $OpenBSD: traphandler.c,v 1.2 2015/01/16 00:05:13 deraadt Exp $ */
/*
* Copyright (c) 2014 Bret Stephen Lambert <blambert@openbsd.org>
*
*/
#include <sys/queue.h>
-#include <sys/param.h>
+#include <sys/param.h> /* nitems */
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/stat.h>
-/* $OpenBSD: usm.c,v 1.8 2014/11/19 11:14:06 blambert Exp $ */
+/* $OpenBSD: usm.c,v 1.9 2015/01/16 00:05:13 deraadt Exp $ */
/*
* Copyright (c) 2012 GeNUA mbH
*/
#include <sys/queue.h>
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/queue.h>
#include <sys/socket.h>