summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorEric Faurot <eric@cvs.openbsd.org>2009-06-04 22:42:16 +0000
committerEric Faurot <eric@cvs.openbsd.org>2009-06-04 22:42:16 +0000
commit2f210698fb6a71a6187d3b5a205462bfb483c3cf (patch)
tree031de2a4a678ea9266414c1514df2427a3c95727 /usr.sbin
parent6424d57e6e8ecdd7b1df9c1390703056bf446fd9 (diff)
change imsg_close() return type to void. It never fails nor does it
return any useful value. "ok now" pyr@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/relayd/imsg.c18
-rw-r--r--usr.sbin/relayd/imsg.h4
2 files changed, 8 insertions, 14 deletions
diff --git a/usr.sbin/relayd/imsg.c b/usr.sbin/relayd/imsg.c
index 6109732c938..d2a3a22d533 100644
--- a/usr.sbin/relayd/imsg.c
+++ b/usr.sbin/relayd/imsg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: imsg.c,v 1.19 2009/06/04 20:31:37 eric Exp $ */
+/* $OpenBSD: imsg.c,v 1.20 2009/06/04 22:42:15 eric Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -134,7 +134,6 @@ imsg_compose(struct imsgbuf *ibuf, u_int16_t type, u_int32_t peerid,
pid_t pid, int fd, void *data, u_int16_t datalen)
{
struct buf *wbuf;
- int n;
if ((wbuf = imsg_create(ibuf, type, peerid, pid, datalen)) == NULL)
return (-1);
@@ -144,10 +143,9 @@ imsg_compose(struct imsgbuf *ibuf, u_int16_t type, u_int32_t peerid,
wbuf->fd = fd;
- if ((n = imsg_close(ibuf, wbuf)) < 0)
- return (-1);
+ imsg_close(ibuf, wbuf);
- return (n);
+ return (1);
}
int
@@ -155,7 +153,6 @@ imsg_composev(struct imsgbuf *ibuf, u_int16_t type, u_int32_t peerid,
pid_t pid, int fd, const struct iovec *iov, int iovcnt)
{
struct buf *wbuf;
- int n;
int i, datalen = 0;
for (i = 0; i < iovcnt; i++)
@@ -170,10 +167,9 @@ imsg_composev(struct imsgbuf *ibuf, u_int16_t type, u_int32_t peerid,
wbuf->fd = fd;
- if ((n = imsg_close(ibuf, wbuf)) < 0)
- return (-1);
+ imsg_close(ibuf, wbuf);
- return (n);
+ return (1);
}
/* ARGSUSED */
@@ -218,7 +214,7 @@ imsg_add(struct buf *msg, void *data, u_int16_t datalen)
return (datalen);
}
-int
+void
imsg_close(struct imsgbuf *ibuf, struct buf *msg)
{
struct imsg_hdr *hdr;
@@ -227,8 +223,6 @@ imsg_close(struct imsgbuf *ibuf, struct buf *msg)
hdr->len = (u_int16_t)msg->wpos;
buf_close(&ibuf->w, msg);
imsg_event_add(ibuf);
-
- return (1);
}
void
diff --git a/usr.sbin/relayd/imsg.h b/usr.sbin/relayd/imsg.h
index c3772fc107d..534b403c7e7 100644
--- a/usr.sbin/relayd/imsg.h
+++ b/usr.sbin/relayd/imsg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: imsg.h,v 1.2 2009/06/04 20:31:37 eric Exp $ */
+/* $OpenBSD: imsg.h,v 1.3 2009/06/04 22:42:15 eric Exp $ */
/*
* Copyright (c) 2006, 2007 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -101,7 +101,7 @@ int imsg_composev(struct imsgbuf *, u_int16_t, u_int32_t, pid_t,
struct buf *imsg_create(struct imsgbuf *, u_int16_t, u_int32_t, pid_t,
u_int16_t);
int imsg_add(struct buf *, void *, u_int16_t);
-int imsg_close(struct imsgbuf *, struct buf *);
+void imsg_close(struct imsgbuf *, struct buf *);
void imsg_free(struct imsg *);
void imsg_event_add(struct imsgbuf *); /* needs to be provided externally */
int imsg_get_fd(struct imsgbuf *);