History

remove unreachable sysfatal() calls after exportfs(), exits(nil) on eof in exportfs

cinap_lenrek committed 10 years ago

Commit 2b60f931 parent bff12ec3 files · +8 −10Browse files

Unified · Split

3 files
  1. cpu.c +0 −2
  2. exportfs/exportfs.c +7 −7
  3. exportfs/exportfs.h +1 −1
cpu.c+0−2
@@ -148,7 +148,6 @@ rcpu(char *host) · 147 unmodified lines
148148
149149 /* Begin serving the namespace */
150150 exportfs(fd);
151− sysfatal("starting exportfs: %r");
152151 }
153152
154153 void
@@ -202,7 +201,6 @@ ncpu(char *host) · 47 unmodified lines
202201
203202 /* Begin serving the gnot namespace */
204203 exportfs(fd);
205− sysfatal("starting exportfs: %r");
206204 }
207205
208206 void
exportfs/exportfs.c+7−7
@@ -80,7 +80,7 @@ exportfs(int fd) · 79 unmodified lines
8080 DEBUG(DFD, "read9p...");
8181 n = read9pmsg(netfd, r->buf, messagesize);
8282 if(n <= 0)
83− fatal("eof: n=%d %r", n);
83+ fatal(nil);
8484
8585 if(convM2S(r->buf, n, &r->work) == 0){
8686 iprint("convM2S %d byte message\n", n);
@@ -489,7 +489,7 @@ fatal(char *s, ...) · 402 unmodified lines
489489 char buf[ERRMAX];
490490 va_list arg;
491491
492− if (s) {
492+ if (s != nil) {
493493 va_start(arg, s);
494494 vsnprint(buf, ERRMAX, s, arg);
495495 va_end(arg);
@@ -499,10 +499,10 @@ fatal(char *s, ...) · 3 unmodified lines
499499 // for(m = Proclist; m; m = m->next)
500500 // postnote(PNPROC, m->pid, "kill");
501501
502− DEBUG(DFD, "%s\n", buf);
503− if (s)
504− sysfatal(buf);
505− else
506− sysfatal("");
502+ if (s != nil) {
503+ DEBUG(DFD, "%s\n", buf);
504+ sysfatal("%s", buf);
505+ } else
506+ exits(nil);
507507 }
508508
exportfs/exportfs.h+1−1
@@ -145,4 +145,4 @@ int readmessage(int, char*, int); · 144 unmodified lines
145145
146146 #define notify(x)
147147 #define noted(x)
148−#define exits(x)
148+