From: reyk Date: Wed, 14 Oct 2015 14:51:57 +0000 (+0000) Subject: sync with httpd - no functional change, just C99 types X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=32c142bf5352d8e4dc791ea6cd0255ad91ce5962;p=openbsd sync with httpd - no functional change, just C99 types --- diff --git a/usr.sbin/snmpd/proc.c b/usr.sbin/snmpd/proc.c index 07910b24474..70ad0087863 100644 --- a/usr.sbin/snmpd/proc.c +++ b/usr.sbin/snmpd/proc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: proc.c,v 1.13 2014/12/16 03:35:49 millert Exp $ */ +/* $OpenBSD: proc.c,v 1.14 2015/10/14 14:51:57 reyk Exp $ */ /* * Copyright (c) 2010 - 2014 Reyk Floeter @@ -42,15 +42,16 @@ void proc_open(struct privsep *, struct privsep_proc *, struct privsep_proc *, size_t); void proc_close(struct privsep *); -int proc_ispeer(struct privsep_proc *, u_int, enum privsep_procid); +int proc_ispeer(struct privsep_proc *, unsigned int, enum privsep_procid); void proc_shutdown(struct privsep_proc *); void proc_sig_handler(int, short, void *); void proc_range(struct privsep *, enum privsep_procid, int *, int *); int -proc_ispeer(struct privsep_proc *procs, u_int nproc, enum privsep_procid type) +proc_ispeer(struct privsep_proc *procs, unsigned int nproc, + enum privsep_procid type) { - u_int i; + unsigned int i; for (i = 0; i < nproc; i++) if (procs[i].p_id == type) @@ -59,9 +60,9 @@ proc_ispeer(struct privsep_proc *procs, u_int nproc, enum privsep_procid type) } void -proc_init(struct privsep *ps, struct privsep_proc *procs, u_int nproc) +proc_init(struct privsep *ps, struct privsep_proc *procs, unsigned int nproc) { - u_int i, j, src, dst; + unsigned int i, j, src, dst; struct privsep_pipes *pp; /* @@ -127,7 +128,7 @@ void proc_kill(struct privsep *ps) { pid_t pid; - u_int i; + unsigned int i; if (privsep_process != PROC_PARENT) return; @@ -151,7 +152,7 @@ proc_open(struct privsep *ps, struct privsep_proc *p, { struct privsep_pipes *pa, *pb; int fds[2]; - u_int i, j, src, proc; + unsigned int i, j, src, proc; if (p == NULL) src = privsep_process; /* parent */ @@ -192,7 +193,7 @@ proc_open(struct privsep *ps, struct privsep_proc *p, void proc_listen(struct privsep *ps, struct privsep_proc *procs, size_t nproc) { - u_int i, dst, src, n, m; + unsigned int i, dst, src, n, m; struct privsep_pipes *pp; /* @@ -201,7 +202,7 @@ proc_listen(struct privsep *ps, struct privsep_proc *procs, size_t nproc) for (src = 0; src < PROC_MAX; src++) { for (n = 0; n < ps->ps_instances[src]; n++) { /* Ingore current process */ - if (src == (u_int)privsep_process && + if (src == (unsigned int)privsep_process && n == ps->ps_instance) continue; @@ -263,7 +264,7 @@ proc_listen(struct privsep *ps, struct privsep_proc *procs, size_t nproc) void proc_close(struct privsep *ps) { - u_int dst, n; + unsigned int dst, n; struct privsep_pipes *pp; if (ps == NULL) @@ -331,14 +332,14 @@ proc_sig_handler(int sig, short event, void *arg) pid_t proc_run(struct privsep *ps, struct privsep_proc *p, - struct privsep_proc *procs, u_int nproc, + struct privsep_proc *procs, unsigned int nproc, void (*init)(struct privsep *, struct privsep_proc *, void *), void *arg) { pid_t pid; struct passwd *pw; const char *root; struct control_sock *rcs; - u_int n; + unsigned int n; if (ps->ps_noaction) return (0); @@ -531,8 +532,8 @@ imsg_event_add(struct imsgev *iev) } int -imsg_compose_event(struct imsgev *iev, u_int16_t type, u_int32_t peerid, - pid_t pid, int fd, void *data, u_int16_t datalen) +imsg_compose_event(struct imsgev *iev, uint16_t type, uint32_t peerid, + pid_t pid, int fd, void *data, uint16_t datalen) { int ret; @@ -544,7 +545,7 @@ imsg_compose_event(struct imsgev *iev, u_int16_t type, u_int32_t peerid, } int -imsg_composev_event(struct imsgev *iev, u_int16_t type, u_int32_t peerid, +imsg_composev_event(struct imsgev *iev, uint16_t type, uint32_t peerid, pid_t pid, int fd, const struct iovec *iov, int iovcnt) { int ret; @@ -571,7 +572,7 @@ proc_range(struct privsep *ps, enum privsep_procid id, int *n, int *m) int proc_compose_imsg(struct privsep *ps, enum privsep_procid id, int n, - u_int16_t type, int fd, void *data, u_int16_t datalen) + uint16_t type, int fd, void *data, uint16_t datalen) { int m; @@ -587,7 +588,7 @@ proc_compose_imsg(struct privsep *ps, enum privsep_procid id, int n, int proc_composev_imsg(struct privsep *ps, enum privsep_procid id, int n, - u_int16_t type, int fd, const struct iovec *iov, int iovcnt) + uint16_t type, int fd, const struct iovec *iov, int iovcnt) { int m;