shithub: riscv

Download patch

ref: 3e52ada202e1e3d27c532921bd38934ec0db1b74
parent: 28bd8adce7264b6f35016fca839391981b404428
parent: 51115b92143e22fef68110036ed42ccb93e0c021
author: cinap_lenrek <[email protected]>
date: Thu Mar 10 14:03:28 EST 2016

merge

--- a/sys/src/cmd/aan.c
+++ b/sys/src/cmd/aan.c
@@ -178,7 +178,7 @@
 	failed = 0;
 	lostsync = 0;
 	while (!done) {
-		if (failed) {
+		if (netfd < 0 || failed) {
 			// Wait for the netreader to die.
 			while (netfd >= 0) {
 				dmessage(1, "main; waiting for netreader to die\n");
@@ -208,7 +208,7 @@
 			}
 
 			if(++lostsync > 2){
-				dmessage(2, "main; lost sync\n");
+				syslog(0, Logname, "connection seems hung up...");
 				failed = 1;
 				continue;
 			}
@@ -217,6 +217,9 @@
 
 		case Unsent:
 			sendp(unacked, b);
+
+			if (netfd < 0)
+				break;
 
 			PBIT32(b->hdr.acked, inmsg);