changeset 2426:e71eca63cb8b

* include/sys/socketvar.h: Fix very old and subtle macro bug. From FreeBSD revision 1.141.2.3 (RELENG_6 branch): "correctly return an error if M_NOWAIT is passed to sblock() and the operation might block."
author asl
date Tue, 11 Sep 2007 16:37:53 +0000
parents 44054a00feca
children 9b5bc3c72ac4
files packages/net/bsd_tcpip/current/ChangeLog packages/net/bsd_tcpip/current/include/sys/bsdtypes.h packages/net/bsd_tcpip/current/include/sys/socketvar.h
diffstat 3 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/packages/net/bsd_tcpip/current/ChangeLog
+++ b/packages/net/bsd_tcpip/current/ChangeLog
@@ -1,3 +1,10 @@
+2007-09-11  Daniel Néri  <daniel.neri@sigicom.se>
+
+	* include/sys/socketvar.h: Fix very old and subtle macro bug. From
+	FreeBSD revision 1.141.2.3 (RELENG_6 branch): "correctly return an
+	error if M_NOWAIT is passed to sblock() and the operation might
+	block."
+
 2007-07-08  Alexander Aganichev <aaganichev@gmail.com>
 
 	* include/sys/param.h (log_): Really disable logging when
--- a/packages/net/bsd_tcpip/current/include/sys/bsdtypes.h
+++ b/packages/net/bsd_tcpip/current/include/sys/bsdtypes.h
@@ -29,6 +29,10 @@
 #undef uint8_t
 #undef uint16_t
 #undef uint32_t
+#undef int8_t
+#undef int16_t
+#undef int32_t
+
 typedef	__signed char		   int8_t;
 typedef	unsigned char		 u_int8_t;
 typedef	unsigned char		  uint8_t;
--- a/packages/net/bsd_tcpip/current/include/sys/socketvar.h
+++ b/packages/net/bsd_tcpip/current/include/sys/socketvar.h
@@ -253,7 +253,7 @@ struct	xsocket {
  */
 #define sblock(sb, wf) ((sb)->sb_flags & SB_LOCK ? \
 		(((wf) == M_WAITOK) ? sb_lock(sb) : EWOULDBLOCK) : \
-		((sb)->sb_flags |= SB_LOCK), 0)
+		((sb)->sb_flags |= SB_LOCK, 0))
 
 /* release lock on sockbuf sb */
 #define	sbunlock(sb) { \