sbspace(): use lmin() instead of imin() and kill now unneeded casts
Pointed out by Scott Barron in kern/13687.
This commit is contained in:
parent
01e394b10d
commit
8c94944fe7
@ -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) \
|
||||
|
Loading…
Reference in New Issue
Block a user