diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2015-10-01 12:16:22 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2015-10-01 12:16:22 +0000 |
commit | b71cecaac32a7a03870d244497a01968505472fa (patch) | |
tree | 6d60085318c46a58d5da2f39f106f82b8c730755 /usr.sbin/relayd/proc.c | |
parent | f2f83bfbbc895cbc3b645c6dab69c15b3d7d9e50 (diff) |
sync proc.c with httpd. no functional change, only switching to C99 types.
Diffstat (limited to 'usr.sbin/relayd/proc.c')
-rw-r--r-- | usr.sbin/relayd/proc.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/usr.sbin/relayd/proc.c b/usr.sbin/relayd/proc.c index f4e5908bf08..c796944827d 100644 --- a/usr.sbin/relayd/proc.c +++ b/usr.sbin/relayd/proc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: proc.c,v 1.20 2015/01/22 17:42:09 reyk Exp $ */ +/* $OpenBSD: proc.c,v 1.21 2015/10/01 12:16:21 reyk Exp $ */ /* * Copyright (c) 2010 - 2014 Reyk Floeter <reyk@openbsd.org> @@ -37,15 +37,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) @@ -54,9 +55,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; /* @@ -122,7 +123,7 @@ void proc_kill(struct privsep *ps) { pid_t pid; - u_int i; + unsigned int i; if (privsep_process != PROC_PARENT) return; @@ -146,7 +147,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 */ @@ -187,7 +188,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; /* @@ -196,7 +197,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; @@ -258,7 +259,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) @@ -326,14 +327,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); @@ -526,8 +527,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; @@ -539,7 +540,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; @@ -566,7 +567,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; @@ -582,7 +583,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; |