diff options
author | 2009-01-13 13:36:12 +0000 | |
---|---|---|
committer | 2009-01-13 13:36:12 +0000 | |
commit | 2a7cd4ce7703df29ed64f9d77ebd26a798405da3 (patch) | |
tree | c68010a0ae96e5125aa119a72dc70b6bb31f5cf2 /sys/kern/uipc_socket2.c | |
parent | +vdsk (diff) | |
download | wireguard-openbsd-2a7cd4ce7703df29ed64f9d77ebd26a798405da3.tar.xz wireguard-openbsd-2a7cd4ce7703df29ed64f9d77ebd26a798405da3.zip |
Change sbreserve() to return 0 on success, 1 on failure, as god intended.
This sort of breaking with traditional and expected behavior annoys me.
"yes!" henning@
Diffstat (limited to 'sys/kern/uipc_socket2.c')
-rw-r--r-- | sys/kern/uipc_socket2.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c index 647edfce827..b7d1097b0ee 100644 --- a/sys/kern/uipc_socket2.c +++ b/sys/kern/uipc_socket2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_socket2.c,v 1.45 2008/11/24 12:57:37 dlg Exp $ */ +/* $OpenBSD: uipc_socket2.c,v 1.46 2009/01/13 13:36:12 blambert Exp $ */ /* $NetBSD: uipc_socket2.c,v 1.11 1996/02/04 02:17:55 christos Exp $ */ /* @@ -364,9 +364,9 @@ int soreserve(struct socket *so, u_long sndcc, u_long rcvcc) { - if (sbreserve(&so->so_snd, sndcc) == 0) + if (sbreserve(&so->so_snd, sndcc)) goto bad; - if (sbreserve(&so->so_rcv, rcvcc) == 0) + if (sbreserve(&so->so_rcv, rcvcc)) goto bad2; if (so->so_rcv.sb_lowat == 0) so->so_rcv.sb_lowat = 1; @@ -391,12 +391,12 @@ sbreserve(struct sockbuf *sb, u_long cc) { if (cc == 0 || cc > sb_max) - return (0); + return (1); sb->sb_hiwat = cc; sb->sb_mbmax = min(cc * 2, sb_max + (sb_max / MCLBYTES) * MSIZE); if (sb->sb_lowat > sb->sb_hiwat) sb->sb_lowat = sb->sb_hiwat; - return (1); + return (0); } /* |