diff options
author | amavect <amavect@gmail.com> | 2021-08-14 19:50:23 +0000 |
---|---|---|
committer | amavect <amavect@gmail.com> | 2021-08-14 19:50:23 +0000 |
commit | e524e8d65a7573c46d7beb49e77bfc2d55a5563d (patch) | |
tree | 2427bb74097741eac6100ba5a85dc85abc6dc939 /sys/src/cmd/exportfs/pattern.c | |
parent | 4e9f39a3ec0712542af0d035c79b3bf0eb2f2cd3 (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/pattern.c')
-rw-r--r-- | sys/src/cmd/exportfs/pattern.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/src/cmd/exportfs/pattern.c b/sys/src/cmd/exportfs/pattern.c index 4dfed5bca..f014a9812 100644 --- a/sys/src/cmd/exportfs/pattern.c +++ b/sys/src/cmd/exportfs/pattern.c @@ -42,7 +42,7 @@ exclusions(void) if(include == nil) fatal("out of memory"); } - DEBUG(DFD, "\tinclude %s\n", line+2); + DEBUG(2, "\tinclude %s\n", line+2); include[ni] = regcomp(line+2); include[++ni] = nil; break; @@ -53,12 +53,12 @@ exclusions(void) if(exclude == nil) fatal("out of memory"); } - DEBUG(DFD, "\texclude %s\n", line+2); + DEBUG(2, "\texclude %s\n", line+2); exclude[ne] = regcomp(line+2); exclude[++ne] = nil; break; default: - DEBUG(DFD, "ignoring pattern %s\n", line); + DEBUG(2, "ignoring pattern %s\n", line); break; } } @@ -76,16 +76,16 @@ excludefile(char *path) else p = path+1; - DEBUG(DFD, "checking %s\n", p); + DEBUG(2, "checking %s\n", p); for(re = include; *re != nil; re++){ if(regexec(*re, p, nil, 0) != 1){ - DEBUG(DFD, "excluded+ %s\n", p); + DEBUG(2, "excluded+ %s\n", p); return -1; } } for(re = exclude; *re != nil; re++){ if(regexec(*re, p, nil, 0) == 1){ - DEBUG(DFD, "excluded- %s\n", p); + DEBUG(2, "excluded- %s\n", p); return -1; } } @@ -98,7 +98,7 @@ preaddir(Fid *f, uchar *data, int n, vlong offset) int r = 0, m; Dir *d; - DEBUG(DFD, "\tpreaddir n=%d wo=%lld fo=%lld\n", n, offset, f->offset); + DEBUG(2, "\tpreaddir n=%d wo=%lld fo=%lld\n", n, offset, f->offset); if(offset == 0 && f->offset != 0){ if(seek(f->fid, 0, 0) != 0) return -1; @@ -128,9 +128,9 @@ preaddir(Fid *f, uchar *data, int n, vlong offset) free(p); } m = convD2M(d, data, n); - DEBUG(DFD, "\t\tconvD2M %d\n", m); + DEBUG(2, "\t\tconvD2M %d\n", m); if(m <= BIT16SZ){ - DEBUG(DFD, "\t\t\tneeded %d\n", GBIT16(data)); + DEBUG(2, "\t\t\tneeded %d\n", GBIT16(data)); /* not enough room for full entry; leave for next time */ f->cdir--; return r; |