Skip to contentSkip to conversation

rwcancel: error should be provided by Unix function

PATCH New [email protected] 1 participant 1 message Jul 17, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rwcancel: error should be provided by Unix function

From: liuhaichao <[email protected]>

Change-Id: I7df1f9e0ce43dbe9c415e834757385dad2398707

---
 rwcancel/rwcancel.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
rwcancel/rwcancel.go +2 -2
index 62397c2..3abfd0a 100644
@@ -92,7 +92,7 @@ func (rw *RWCancel) Read(p []byte) (n int, err error) {
 			return n, err
 		}
 		if !rw.ReadyRead() {
-			return 0, errors.New("fd closed")
+			continue
 		}
 	}
 }
@@ -104,7 +104,7 @@ func (rw *RWCancel) Write(p []byte) (n int, err error) {
 			return n, err
 		}
 		if !rw.ReadyWrite() {
-			return 0, errors.New("fd closed")
+			continue
 		}
 	}
 }
Signature · 6 lines
2.19.1

_______________________________________________
WireGuard mailing list
[email protected]
https://lists.zx2c4.com/mailman/listinfo/wireguard