Patch for socket.c

Samuel Bronson sjb204 at lehigh.edu
Tue Feb 15 17:55:49 PST 2005


`make plugins' gave me this:

make[1]: Entering directory `/home/naesten/slate/src/plugins/socket'
libtool --mode=compile gcc -O2 -fomit-frame-pointer -DNDEBUG=1 -s
-I../../../src/mobius/vm/platform/includes -I. -I../../..
-DSLATE_DATADIR=\"/usr/share/slate\" -o unix/socket.lo -c unix/socket.c
mkdir unix/.libs
 gcc -O2 -fomit-frame-pointer -DNDEBUG=1 -s
-I../../../src/mobius/vm/platform/includes -I. -I../../..
-DSLATE_DATADIR=\"/usr/share/slate\" -c unix/socket.c  -fPIC -DPIC -o
unix/.libs/socket.o
unix/socket.c: In function `socket_HandleSetAdd':
unix/socket.c:154: error: parse error before "asm"
unix/socket.c: In function `socket_HandleSetRemove':
unix/socket.c:158: error: parse error before "asm"

so I did this:
--- src/plugins/socket/unix/socket.c	4 Feb 2005 16:31:38 -0000	1.5
+++ src/plugins/socket/unix/socket.c	16 Feb 2005 00:43:01 -0000
@@ -151,11 +151,13 @@
 }
 
 int socket_HandleSetAdd(int set, int fd) {
-  return (set < num_HandleSets) ? FD_SET(fd, &HandleSets[set]) : -1;
+  if (set >= num_HandleSets) return -1;
+  FD_SET(fd, &HandleSets[set]); return 0;
 }
 
 int socket_HandleSetRemove(int set, int fd) {
-  return (set < num_HandleSets) ? FD_CLR(fd, &HandleSets[set]) : -1;
+  if (set >= num_HandleSets) return -1;
+  FD_CLR(fd, &HandleSets[set]); return 0;
 }
 
 int socket_SelectHandles(int count, int rset, int wset, int next) {






More information about the Slate mailing list