summaryrefslogtreecommitdiff
path: root/sys/src/cmd/exportfs/io.c
diff options
context:
space:
mode:
authoramavect <amavect@gmail.com>2021-08-14 19:50:23 +0000
committeramavect <amavect@gmail.com>2021-08-14 19:50:23 +0000
commite524e8d65a7573c46d7beb49e77bfc2d55a5563d (patch)
tree2427bb74097741eac6100ba5a85dc85abc6dc939 /sys/src/cmd/exportfs/io.c
parent4e9f39a3ec0712542af0d035c79b3bf0eb2f2cd3 (diff)
exportfs: make -d log to stderr
exportfs -d logs 9p traffic to /tmp/exportdb. -f allows writing to a different file. exportfs silently continues if it doesn't have permissions to create or write to /tmp/exportdb. These are poor behaviors. A better default is to write to stderr, since it is 9P debug info that is better immediately printed, and not user info that is better handled by syslog(). As a result, -f is obsolete and thus removed. Redirect responsibility is now on rc. As a side effect, rc will fail if it doesn't have permissions to write. exportfs(4) is updated to reflect all changes and with a better Synopsis.
Diffstat (limited to 'sys/src/cmd/exportfs/io.c')
-rw-r--r--sys/src/cmd/exportfs/io.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/src/cmd/exportfs/io.c b/sys/src/cmd/exportfs/io.c
index ad1d7154b..2309168a8 100644
--- a/sys/src/cmd/exportfs/io.c
+++ b/sys/src/cmd/exportfs/io.c
@@ -49,7 +49,7 @@ io(void)
if(convM2S(r->buf, n, &r->work) != n)
fatal("convM2S format error");
- DEBUG(DFD, "%F\n", &r->work);
+ DEBUG(2, "%F\n", &r->work);
(fcalls[r->work.type])(r);
}
}
@@ -69,7 +69,7 @@ reply(Fcall *r, Fcall *t, char *err)
else
t->type = r->type + 1;
- DEBUG(DFD, "\t%F\n", t);
+ DEBUG(2, "\t%F\n", t);
data = malloc(messagesize); /* not mallocz; no need to clear */
if(data == nil)
@@ -224,7 +224,7 @@ freefile(File *f)
while(--f->ref == 0){
freecnt++;
- DEBUG(DFD, "free %s\n", f->name);
+ DEBUG(2, "free %s\n", f->name);
/* delete from parent */
parent = f->parent;
if(parent->child == f)
@@ -250,7 +250,7 @@ file(File *parent, char *name)
char *path;
File *f;
- DEBUG(DFD, "\tfile: 0x%p %s name %s\n", parent, parent->name, name);
+ DEBUG(2, "\tfile: 0x%p %s name %s\n", parent, parent->name, name);
path = makepath(parent, name);
if(patternfile != nil && excludefile(path)){
@@ -429,17 +429,17 @@ uniqueqid(Dir *d)
}
path = d->qid.path;
while(qidexists(path)){
- DEBUG(DFD, "collision on %s\n", d->name);
+ DEBUG(2, "collision on %s\n", d->name);
/* collision: find a new one */
ncollision++;
path &= QIDPATH;
++newqid;
if(newqid >= (1<<16)){
- DEBUG(DFD, "collision wraparound\n");
+ DEBUG(2, "collision wraparound\n");
newqid = 1;
}
path |= newqid<<48;
- DEBUG(DFD, "assign qid %.16llux\n", path);
+ DEBUG(2, "assign qid %.16llux\n", path);
}
qidcnt++;
q = emallocz(sizeof(Qidtab));
@@ -472,7 +472,7 @@ fatal(char *s, ...)
postnote(PNPROC, m->pid, "kill");
if(s != nil) {
- DEBUG(DFD, "%s\n", buf);
+ DEBUG(2, "%s\n", buf);
sysfatal("%s", buf); /* caution: buf could contain '%' */
} else
exits(nil);