  		lasttime = nextpkt_tv;
  
  		/* Did we exceed the limit on the number of packets to send? */
-@@ -1382,6 +1410,10 @@
+@@ -1382,6 +1412,10 @@
  						   pktlen,
  						   &(cur_tg->stop_before),
  						   &pktid);

 			    (void)close(sfd);
diff -ru dist-tg2.0/src/tg/tg.y tg2.0/src/tg/tg.y
--- dist-tg2.0/src/tg/tg.y	Thu Jan 24 16:30:10 2002
+++ tg2.0/src/tg/tg.y	Thu May  2 14:13:33 2002
@@ -133,7 +133,11 @@
 char                    *version = "2.0";	/* TG program version.	*/
 char			*ofile = NULL;

 		}
 
 	/* Finished, tear down connection.				*/
@@ -1154,8 +1175,11 @@
 		/* log the teardown error. */
 
 		perror("do_actions: protocol teardown");
+#ifndef USEEVENTS
 		exit(-1);
+#endif
 		}
+	active_tx_asn = -1;
 
 	return;
 	}
@@ -1341,6 +1365,12 @@
 
 		if (arrival != 0)
 			(*(prot.prot->sleep_till))(&nextpkt_tv);
