WireGuard Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] rwcancel: error should be provided by Unix function
@ 2019-07-02  9:12 liuhaichao
  0 siblings, 0 replies; only message in thread
From: liuhaichao @ 2019-07-02  9:12 UTC (permalink / raw)
  To: wireguard; +Cc: liuhaichao

From: liuhaichao <liuhaichao@bytedance.com>

Change-Id: I7df1f9e0ce43dbe9c415e834757385dad2398707
---
 rwcancel/rwcancel.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/rwcancel/rwcancel.go b/rwcancel/rwcancel.go
index 62397c2..3abfd0a 100644
--- a/rwcancel/rwcancel.go
+++ b/rwcancel/rwcancel.go
@@ -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
 		}
 	}
 }
-- 
2.19.1

_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-02  9:12 [PATCH] rwcancel: error should be provided by Unix function liuhaichao

WireGuard Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/wireguard/0 wireguard/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 wireguard wireguard/ https://lore.kernel.org/wireguard \
		wireguard@lists.zx2c4.com zx2c4-wireguard@archiver.kernel.org
	public-inbox-index wireguard


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/com.zx2c4.lists.wireguard


AGPL code for this site: git clone https://public-inbox.org/ public-inbox