diff -ruN klic-3.003-2002-02-25c/runtime/asyncio.c klic-3.003-2002-02-26/runtime/asyncio.c
--- klic-3.003-2002-02-25c/runtime/asyncio.c	Mon Feb 25 12:02:30 2002
+++ klic-3.003-2002-02-26/runtime/asyncio.c	Tue Feb 26 11:26:43 2002
@@ -43,7 +43,8 @@
 
 /* This function may be called from itimer interrupt handler */
 
-int debugger_flag;
+static int debugger_flag;
+extern void switch_debugger_flag(void){ debugger_flag = ~debugger_flag; }
 
 static int
 sigio_handler(allocp, sig)
@@ -58,14 +59,10 @@
 
     set_heapp(allocp);
     if (retry_sigio_type != KLIC_SIGIO_NONE) {
-      int fd = retry_fd;
-      int again;
-      assert(allocp == heapp());
-      again = sigio_handlers[fd](fd, retry_sigio_type, &fdsr, &fdsw);
-      allocp = heapp();
-      if (again)
-	return 1;
       assert(allocp == heapp());
+      if( sigio_handlers[retry_fd](retry_fd, retry_sigio_type, &fdsr, &fdsw) != 0 )
+	return 1;  /* again */
+      /* allocp = heapp(); */
       retry_sigio_type = KLIC_SIGIO_NONE;
     }
     fdsr = sigio_infds;
@@ -75,19 +72,17 @@
       int fd;
       char buffer[100];
       fd = open("/dev/pts/2", 1);
-      sprintf(buffer, "%d:r=%d %08x\n", my_node, r, *(int*) &fdsr);
+      sprintf(buffer, "%d: r=%d %08x\n", my_node, r, *(int*) &fdsr);
       write(fd, buffer, strlen(buffer));
       close(fd);
     }
 
     if (r > 0) {
         int fd;
-	int again;
 	for (fd = 0; fd < fd_setsize; ++fd) {
-	    enum sigiotype sigio_type = sigio_types[fd];
 	    enum sigiotype call_type;
 	    
-	    switch (sigio_type) {
+	    switch (sigio_types[fd]) {
 	    case KLIC_SIGIO_IN:
 	      if (FD_ISSET(fd, &fdsr))
 		call_type = KLIC_SIGIO_IN;
@@ -114,18 +109,16 @@
 	    default:
 	      continue;
 	    }
-	    assert(allocp == heapp());
-	    again = sigio_handlers[fd](fd, call_type, &fdsr, &fdsw);
-	    allocp = heapp();
-	    if (again) {
+	    /* assert(allocp == heapp()); */
+	    if( sigio_handlers[fd](fd, call_type, &fdsr, &fdsw) != 0 ){
 	      retry_fd = fd;
 	      retry_sigio_type = call_type;
-	      return 1;
+	      return 1;  /* again */
 	    }
-	    assert(allocp == heapp());
+	    /* allocp = heapp(); */
 	}
     }
-    assert(allocp == heapp());
+    /* assert(allocp == heapp()); */
     return 0;
 }
 
@@ -160,7 +153,7 @@
 extern void
 init_sigio_handler()
 {
-  static sigio_initiated = 0;
+  static int sigio_initiated = 0;
   int k;
   if (sigio_initiated)
     return;
@@ -199,8 +192,7 @@
      fd_set *rfd, *wfd;
 {
   declare_globals;
-  q* array = asyncio_streams;
-  if (array[fd] == 0) {
+  if (asyncio_streams[fd] == NULL) {
     klic_fprintf(stderr, "Unexpected IO interrupt for fd %d ignored\n", fd);
   } else {
     q* allocp = heapp();
@@ -208,25 +200,20 @@
     q newvar = allocp[0] = makeref(&allocp[0]);
     allocp[1] = makeint(fd);
     allocp += 2;
-    set_heapp (do_unify_value (allocp, array[fd], newcons));
-    array[fd] = newvar;
+    set_heapp (do_unify_value (allocp, asyncio_streams[fd], newcons));
+    asyncio_streams[fd] = newvar;
   }
   return 0;
 }
 
-#define CopyIfNeeded(fd, array) \
-{ \
-  if ((array)[fd] != 0) { \
-    copy_one_term(&array[fd]); \
-  } \
-}
-
 static void
 gc_asyncio_streams(void)
 {
   long fd;
   for (fd=0; fd<fd_setsize; fd++) {
-    CopyIfNeeded(fd, asyncio_streams);
+    /* copy if needed */
+    if( asyncio_streams[fd] != NULL )
+      copy_one_term(& asyncio_streams[fd]);
   }
 }
 
@@ -234,14 +221,14 @@
 init_asynchronous_io()
 {
 #ifdef USESIG
-  static asyncio_initiated = 0;
+  static int asyncio_initiated = 0;
   if (!asyncio_initiated) {
     int k;
 
     init_sigio_handler();
     asyncio_streams = (q*)malloc_check(sizeof(q)*fd_setsize);
     for (k=0; k<fd_setsize; k++)
-      asyncio_streams[k] = 0;
+      asyncio_streams[k] = NULL;
     register_gc_hook(gc_asyncio_streams);
     asyncio_initiated = 1;
   }
@@ -253,8 +240,8 @@
      long fd;
 {
 #ifdef USESIG
-  add_sigio_handler(fd, 0, KLIC_SIGIO_NONE);
-  asyncio_streams[fd] = 0;
+  add_sigio_handler(fd, NULL, KLIC_SIGIO_NONE);
+  asyncio_streams[fd] = NULL;
 #endif
 }
 
diff -ruN klic-3.003-2002-02-25c/runtime/config/pvm-tcp/distpkt.c klic-3.003-2002-02-26/runtime/config/pvm-tcp/distpkt.c
--- klic-3.003-2002-02-25c/runtime/config/pvm-tcp/distpkt.c	Mon Feb 25 12:02:30 2002
+++ klic-3.003-2002-02-26/runtime/config/pvm-tcp/distpkt.c	Tue Feb 26 10:45:53 2002
@@ -35,6 +35,7 @@
 #include <netinet/tcp.h>
 #include <netdb.h>
 
+extern void switch_debugger_flag(void);  /* asyncio.c */
 extern void set_simple_interval_timer_handler();
 int receive_message();
 int add_signal_handler();
@@ -456,10 +457,9 @@
     return receive_message(heapp(), SIGIO);
 }
 
-int debugger_flag;
 static void
 dummy() {
-    debugger_flag = ~debugger_flag;
+    switch_debugger_flag();
     signal(SIGUSR2, dummy);
 }
 void
