]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/cmd/lnfs.c
aux/realemu: run cpuproc in same fd group as fileserver
[plan9front.git] / sys / src / cmd / lnfs.c
old mode 100755 (executable)
new mode 100644 (file)
index c34669b..dcc2a24
@@ -526,22 +526,11 @@ io(void)
 
        pid = getpid();
 
-       for(;;){
-               /*
-                * reading from a pipe or a network device
-                * will give an error after a few eof reads.
-                * however, we cannot tell the difference
-                * between a zero-length read and an interrupt
-                * on the processes writing to us,
-                * so we wait for the error.
-                */
-               n = read9pmsg(mfd[0], mdata, messagesize);
+       while((n = read9pmsg(mfd[0], mdata, messagesize)) != 0){
                if(n < 0)
-                       sysfatal("mount read");
-               if(n == 0)
-                       continue;
-               if(convM2S(mdata, n, &thdr) == 0)
-                       continue;
+                       sysfatal("mount read: %r");
+               if(convM2S(mdata, n, &thdr) != n)
+                       sysfatal("convM2S format error: %r");
 
                if(debug)
                        fprint(2, "%s %d:<-%F\n", argv0, pid, &thdr);