Browse Source

constify data parameter in imsg_add() and imsg_compose()

ok deraadt@
OPENBSD_5_5
eric 11 years ago
parent
commit
abf1c90f5d
3 changed files with 10 additions and 10 deletions
  1. +3
    -3
      src/lib/libutil/imsg.c
  2. +3
    -3
      src/lib/libutil/imsg.h
  3. +4
    -4
      src/lib/libutil/imsg_init.3

+ 3
- 3
src/lib/libutil/imsg.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: imsg.c,v 1.4 2013/02/01 15:22:18 gilles Exp $ */
/* $OpenBSD: imsg.c,v 1.5 2013/12/26 17:32:33 eric Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -164,7 +164,7 @@ imsg_get(struct imsgbuf *ibuf, struct imsg *imsg)
int
imsg_compose(struct imsgbuf *ibuf, u_int32_t type, u_int32_t peerid,
pid_t pid, int fd, void *data, u_int16_t datalen)
pid_t pid, int fd, const void *data, u_int16_t datalen)
{
struct ibuf *wbuf;
@ -234,7 +234,7 @@ imsg_create(struct imsgbuf *ibuf, u_int32_t type, u_int32_t peerid,
}
int
imsg_add(struct ibuf *msg, void *data, u_int16_t datalen)
imsg_add(struct ibuf *msg, const void *data, u_int16_t datalen)
{
if (datalen)
if (ibuf_add(msg, data, datalen) == -1) {


+ 3
- 3
src/lib/libutil/imsg.h View File

@ -1,4 +1,4 @@
/* $OpenBSD: imsg.h,v 1.2 2010/06/23 07:53:55 nicm Exp $ */
/* $OpenBSD: imsg.h,v 1.3 2013/12/26 17:32:33 eric Exp $ */
/*
* Copyright (c) 2006, 2007 Pierre-Yves Ritschard <pyr@openbsd.org>
@ -98,12 +98,12 @@ void imsg_init(struct imsgbuf *, int);
ssize_t imsg_read(struct imsgbuf *);
ssize_t imsg_get(struct imsgbuf *, struct imsg *);
int imsg_compose(struct imsgbuf *, u_int32_t, u_int32_t, pid_t,
int, void *, u_int16_t);
int, const void *, u_int16_t);
int imsg_composev(struct imsgbuf *, u_int32_t, u_int32_t, pid_t,
int, const struct iovec *, int);
struct ibuf *imsg_create(struct imsgbuf *, u_int32_t, u_int32_t, pid_t,
u_int16_t);
int imsg_add(struct ibuf *, void *, u_int16_t);
int imsg_add(struct ibuf *, const void *, u_int16_t);
void imsg_close(struct imsgbuf *, struct ibuf *);
void imsg_free(struct imsg *);
int imsg_flush(struct imsgbuf *);


+ 4
- 4
src/lib/libutil/imsg_init.3 View File

@ -1,4 +1,4 @@
.\" $OpenBSD: imsg_init.3,v 1.10 2013/11/13 21:04:46 benno Exp $
.\" $OpenBSD: imsg_init.3,v 1.11 2013/12/26 17:32:33 eric Exp $
.\"
.\" Copyright (c) 2010 Nicholas Marriott <nicm@openbsd.org>
.\"
@ -14,7 +14,7 @@
.\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
.\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: November 13 2013 $
.Dd $Mdocdate: December 26 2013 $
.Dt IMSG_INIT 3
.Os
.Sh NAME
@ -57,7 +57,7 @@
.Fn imsg_get "struct imsgbuf *ibuf" "struct imsg *imsg"
.Ft int
.Fn imsg_compose "struct imsgbuf *ibuf" "u_int32_t type" "uint32_t peerid" \
"pid_t pid" "int fd" "void *data" "u_int16_t datalen"
"pid_t pid" "int fd" "const void *data" "u_int16_t datalen"
.Ft int
.Fn imsg_composev "struct imsgbuf *ibuf" "u_int32_t type" "u_int32_t peerid" \
"pid_t pid" "int fd" "const struct iovec *iov" "int iovcnt"
@ -65,7 +65,7 @@
.Fn imsg_create "struct imsgbuf *ibuf" "u_int32_t type" "u_int32_t peerid" \
"pid_t pid" "u_int16_t datalen"
.Ft int
.Fn imsg_add "struct ibuf *buf" "void *data" "u_int16_t datalen"
.Fn imsg_add "struct ibuf *buf" "const void *data" "u_int16_t datalen"
.Ft void
.Fn imsg_close "struct imsgbuf *ibuf" "struct ibuf *msg"
.Ft void


Loading…
Cancel
Save