From 8c94944fe73808b332532a067fef0c12e828e74e Mon Sep 17 00:00:00 2001 From: jdolecek Date: Fri, 28 Sep 2001 18:02:45 +0000 Subject: [PATCH] sbspace(): use lmin() instead of imin() and kill now unneeded casts Pointed out by Scott Barron in kern/13687. --- sys/sys/socketvar.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h index ff6a3cff5cb6..e3e66264bf50 100644 --- a/sys/sys/socketvar.h +++ b/sys/sys/socketvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: socketvar.h,v 1.49 2001/07/01 20:42:48 matt Exp $ */ +/* $NetBSD: socketvar.h,v 1.50 2001/09/28 18:02:45 jdolecek Exp $ */ /*- * Copyright (c) 1982, 1986, 1990, 1993 @@ -160,11 +160,10 @@ struct socket { * How much space is there in a socket buffer (so->so_snd or so->so_rcv)? * This is problematical if the fields are unsigned, as the space might * still be negative (cc > hiwat or mbcnt > mbmax). Should detect - * overflow and return 0. Should use "lmin" but it doesn't exist now. + * overflow and return 0. */ #define sbspace(sb) \ - ((long) imin((int)((sb)->sb_hiwat - (sb)->sb_cc), \ - (int)((sb)->sb_mbmax - (sb)->sb_mbcnt))) + (lmin((sb)->sb_hiwat - (sb)->sb_cc, (sb)->sb_mbmax - (sb)->sb_mbcnt)) /* do we have to send all at once on a socket? */ #define sosendallatonce(so) \