summaryrefslogtreecommitdiff
path: root/sys/src/cmd/upas
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2016-07-24 02:17:45 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2016-07-24 02:17:45 +0200
commita840b597cad282e837560b65dad89aa0cfd4af77 (patch)
tree8e44abab443bbb9369ab1074871e7ebb25f499f8 /sys/src/cmd/upas
parent518a40ae95535f2b6fc59397155267d54c858343 (diff)
upas/fs: remove checkmboxrefs() debugging code, properly handle errors in 9p loop
Diffstat (limited to 'sys/src/cmd/upas')
-rw-r--r--sys/src/cmd/upas/fs/dat.h1
-rw-r--r--sys/src/cmd/upas/fs/fs.c39
2 files changed, 4 insertions, 36 deletions
diff --git a/sys/src/cmd/upas/fs/dat.h b/sys/src/cmd/upas/fs/dat.h
index 4a1a4b498..d21de3ed5 100644
--- a/sys/src/cmd/upas/fs/dat.h
+++ b/sys/src/cmd/upas/fs/dat.h
@@ -145,7 +145,6 @@ void parseunix(Message*);
String* date822tounix(char*);
int fidmboxrefs(Mailbox*);
int hashmboxrefs(Mailbox*);
-void checkmboxrefs(void);
extern int debug;
extern int fflag;
diff --git a/sys/src/cmd/upas/fs/fs.c b/sys/src/cmd/upas/fs/fs.c
index b07c793ed..fffb290aa 100644
--- a/sys/src/cmd/upas/fs/fs.c
+++ b/sys/src/cmd/upas/fs/fs.c
@@ -1165,23 +1165,11 @@ io(void)
}
}
- 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
- */
- checkmboxrefs();
- n = read9pmsg(mfd[0], mdata, messagesize);
- if(n == 0)
- continue;
+ while((n = read9pmsg(mfd[0], mdata, messagesize)) != 0){
if(n < 0)
- return;
- if(convM2S(mdata, n, &thdr) == 0)
- continue;
+ error("mount read");
+ if(convM2S(mdata, n, &thdr) != n)
+ error("convM2S format error");
if(debug)
fprint(2, "%s:<-%F\n", argv0, &thdr);
@@ -1617,25 +1605,6 @@ hashmboxrefs(Mailbox *mb)
}
void
-checkmboxrefs(void)
-{
- int f, refs;
- Mailbox *mb;
-
- qlock(&mbllock);
- for(mb=mbl; mb; mb=mb->next){
- qlock(mb);
- refs = (f=fidmboxrefs(mb))+1;
- if(refs != mb->refs){
- fprint(2, "mbox %s %s ref mismatch actual %d (%d+1) expected %d\n", mb->name, mb->path, refs, f, mb->refs);
- abort();
- }
- qunlock(mb);
- }
- qunlock(&mbllock);
-}
-
-void
post(char *name, char *envname, int srvfd)
{
int fd;