[cl-debian] Bug#385713: [PATCH] missed else is cause for broken socket write

Bernhard R. Link brlink at debian.org
Sat Sep 2 15:27:15 UTC 2006


Afte debugging around a bit I found the following in the .diff.gz
causing this (in h/object.c):

@@ -514,9 +514,7 @@
 };
 /* flags */
 #define GET_STREAM_FLAG(strm,name) ((strm)->sm.sm_flags & (1<<(name)))
-#define SET_STREAM_FLAG(strm,name,val) (val ? \
-                       ((strm)->sm.sm_flags |= (1<<(name))) : \
-                       ((strm)->sm.sm_flags &= ~(1<<(name)))) 
+#define SET_STREAM_FLAG(strm,name,val) {if (val) (strm)->sm.sm_flags |= (1<<(na
me)); (strm)->sm.sm_flags &= ~(1<<(name));} 
 
 #define GCL_MODE_BLOCKING 1
 #define GCL_MODE_NON_BLOCKING 0

There is obviously a else gone missing. The attached patch (against -19,
as packages.d.o still links to that) solved the problem.

Hochachtungsvoll,
	Bernhard R. Link
-------------- next part --------------
--- gcl-2.6.7.old/h/object.h	2006-09-02 21:57:41.000000000 +0000
+++ gcl-2.6.7/h/object.h	2006-09-02 15:15:20.000000000 +0000
@@ -514,7 +514,7 @@
 };
 /* flags */
 #define GET_STREAM_FLAG(strm,name) ((strm)->sm.sm_flags & (1<<(name)))
-#define SET_STREAM_FLAG(strm,name,val) {if (val) (strm)->sm.sm_flags |= (1<<(name)); (strm)->sm.sm_flags &= ~(1<<(name));} 
+#define SET_STREAM_FLAG(strm,name,val) {if (val) (strm)->sm.sm_flags |= (1<<(name)); else (strm)->sm.sm_flags &= ~(1<<(name));} 
 
 #define GCL_MODE_BLOCKING 1
 #define GCL_MODE_NON_BLOCKING 0


More information about the Cl-debian mailing list