upas/fs: remove checkmboxrefs() debugging code, properly handle errors in 9p loop

This commit is contained in:
cinap_lenrek 2016-07-24 02:17:45 +02:00
parent 518a40ae95
commit a840b597ca
2 changed files with 4 additions and 36 deletions

View file

@ -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;

View file

@ -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);
@ -1616,25 +1604,6 @@ hashmboxrefs(Mailbox *mb)
return refs;
}
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)
{