aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/9pfuse
diff options
context:
space:
mode:
authorXiao-Yong Jin <xjin@anl.gov>2018-03-14 20:27:46 -0500
committerDavid du Colombier <0intro@gmail.com>2018-03-23 10:36:08 +0100
commit112744e54bfdab025bd2146457f41f1f8f4a903b (patch)
tree1fead8ef99f9d87fee880de841951801056dde69 /src/cmd/9pfuse
parent4798a8a5560552480efde5fe8b1f7963a25a96d3 (diff)
downloadplan9port-112744e54bfdab025bd2146457f41f1f8f4a903b.tar.gz
plan9port-112744e54bfdab025bd2146457f41f1f8f4a903b.tar.bz2
plan9port-112744e54bfdab025bd2146457f41f1f8f4a903b.zip
9pfuse: retries read(3) upon EINTR
read(3) sometimes errors with EINTR on macOS over slow connections. 9pfuse(1) now retries read(3) instead of sysfatal(3)ing.
Diffstat (limited to 'src/cmd/9pfuse')
-rw-r--r--src/cmd/9pfuse/fuse.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cmd/9pfuse/fuse.c b/src/cmd/9pfuse/fuse.c
index 3f91ce78..b84663e9 100644
--- a/src/cmd/9pfuse/fuse.c
+++ b/src/cmd/9pfuse/fuse.c
@@ -48,7 +48,6 @@ readfusemsg(void)
int n, nn;
m = allocfusemsg();
- errno = 0;
/*
* The FUSE kernel device apparently guarantees
* that this read will return exactly one message.
@@ -57,7 +56,11 @@ readfusemsg(void)
* FUSE returns an ENODEV error, not EOF,
* when the connection is unmounted.
*/
- if((n = read(fusefd, m->buf, fusebufsize)) < 0){
+ do{
+ errno = 0;
+ n = read(fusefd, m->buf, fusebufsize);
+ }while(n < 0 && errno == EINTR);
+ if(n < 0){
if(errno != ENODEV)
sysfatal("readfusemsg: %r");
}