summaryrefslogtreecommitdiffstats
path: root/usr.sbin/switchd/imsg_util.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/switchd/imsg_util.c')
-rw-r--r--usr.sbin/switchd/imsg_util.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/usr.sbin/switchd/imsg_util.c b/usr.sbin/switchd/imsg_util.c
index dccc01b8def..e7e79fdee1d 100644
--- a/usr.sbin/switchd/imsg_util.c
+++ b/usr.sbin/switchd/imsg_util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: imsg_util.c,v 1.4 2016/09/29 17:03:00 reyk Exp $ */
+/* $OpenBSD: imsg_util.c,v 1.5 2016/09/30 11:57:57 reyk Exp $ */
/*
* Copyright (c) 2010-2016 Reyk Floeter <reyk@openbsd.org>
@@ -208,6 +208,15 @@ ibuf_setsize(struct ibuf *buf, size_t len)
}
int
+ibuf_setmax(struct ibuf *buf, size_t len)
+{
+ if (len > buf->size)
+ return (-1);
+ buf->max = len;
+ return (0);
+}
+
+int
ibuf_prepend(struct ibuf *buf, void *data, size_t len)
{
struct ibuf *new;