Commit Diff


commit - 4798a8a5560552480efde5fe8b1f7963a25a96d3
commit + 112744e54bfdab025bd2146457f41f1f8f4a903b
blob - 3f91ce787c6c03f0f947021b49d252dc7c04ef63
blob + b84663e99fad3889fcb3a2c73fe5bcfd43abe5d8
--- src/cmd/9pfuse/fuse.c
+++ 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");
 	}