diff options
author | 2014-12-25 22:20:52 +0000 | |
---|---|---|
committer | 2014-12-25 22:20:52 +0000 | |
commit | ec2a4e0ffccc34360c4f69d28ae1a71cb6ee178a (patch) | |
tree | 37d1716ac024143104a9971d81ba357af84b3138 /lib/libutil/imsg-buffer.c | |
parent | Use archdep.h GOT_PERMS define for mprotect of GOT. okay kettenis@ (diff) | |
download | wireguard-openbsd-ec2a4e0ffccc34360c4f69d28ae1a71cb6ee178a.tar.xz wireguard-openbsd-ec2a4e0ffccc34360c4f69d28ae1a71cb6ee178a.zip |
return ERANGE instead of ENOMEM, so callers can differentiate real oom
from this case where we have a static buffer and cant realloc.
ok phessler, claudio, reyk
Diffstat (limited to 'lib/libutil/imsg-buffer.c')
-rw-r--r-- | lib/libutil/imsg-buffer.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libutil/imsg-buffer.c b/lib/libutil/imsg-buffer.c index 65413c08e1d..318f9184998 100644 --- a/lib/libutil/imsg-buffer.c +++ b/lib/libutil/imsg-buffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: imsg-buffer.c,v 1.4 2014/06/30 00:25:17 deraadt Exp $ */ +/* $OpenBSD: imsg-buffer.c,v 1.5 2014/12/25 22:20:52 benno Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -74,7 +74,7 @@ ibuf_realloc(struct ibuf *buf, size_t len) /* on static buffers max is eq size and so the following fails */ if (buf->wpos + len > buf->max) { - errno = ENOMEM; + errno = ERANGE; return (-1); } |