r2036

dslinux_amadeus at dslinux.in-berlin.de dslinux_amadeus at dslinux.in-berlin.de
Sat Nov 10 12:47:57 CET 2007


Author: amadeus
Date: 2007-11-10 12:47:52 +0100 (Sat, 10 Nov 2007)
New Revision: 2036

Log:
lower probability of protocol interference in event handling

Modified: trunk/user/microwin/src/nanox/nxproto.c
===================================================================
--- trunk/user/microwin/src/nanox/nxproto.c	2007-11-09 13:04:10 UTC (rev 2035)
+++ trunk/user/microwin/src/nanox/nxproto.c	2007-11-10 11:47:52 UTC (rev 2036)
@@ -171,7 +171,7 @@
 			 * as it has to be sent over the socket to wake
 			 * up the Nano-X server.
 			 */
-			char c;
+			unsigned char c;
 			nxShmCmdsFlushReq req;
 
 			req.reqType = GrNumShmCmdsFlush;
@@ -184,12 +184,12 @@
 
 			if ( reply_needed ) {
 				do {
-					/* wait for the response byte ("1") from the server */
+					/* wait for the response byte ("0xA5") from the server */
 					while ( read(nxSocket, &c, 1) != 1 )
 						;
-					if (c != 1)
+					if (c != 0xA5)
 						poll_buffer[poll_write++] = c;
-				} while (c != 1);
+				} while (c != 0xA5);
 			}
 			reqbuf.bufptr = reqbuf.buffer;
 

Modified: trunk/user/microwin/src/nanox/srvnet.c
===================================================================
--- trunk/user/microwin/src/nanox/srvnet.c	2007-11-09 13:04:10 UTC (rev 2035)
+++ trunk/user/microwin/src/nanox/srvnet.c	2007-11-10 11:47:52 UTC (rev 2036)
@@ -1761,7 +1761,7 @@
 		/* No or short shm present serverside, bug or mischief */
 		EPRINTF("nano-X: Ill behaved client assumes shm ok\n");
 		if ( req->reply ) {
-			reply = 0;
+			reply = 0xA5;
 			GsWrite(current_fd, &reply, 1);
 		}
 		return;
@@ -1782,13 +1782,13 @@
 	}
 
 	if ( req->reply ) {
-		reply = 1;
+		reply = 0xA5;
 		GsWrite(current_fd, &reply, 1);
 	}
 #else
 	/* no shared memory support*/
 	if ( req->reply ) {
-		reply = 0;
+		reply = 0xA5;
 		GsWrite(current_fd, &reply, 1);
 	}
 #endif /* HAVE_SHAREDMEM_SUPPORT*/




More information about the dslinux-commit mailing list