diff options
author | amavect <amavect@gmail.com> | 2021-08-18 17:51:40 +0000 |
---|---|---|
committer | amavect <amavect@gmail.com> | 2021-08-18 17:51:40 +0000 |
commit | 0f58e47551345d7c48c9404bc4188f7fc195e51a (patch) | |
tree | 3c6487a3aaf48d05382687a500589967fa5bd94b /sys/src/cmd/exportfs/pattern.c | |
parent | 8c228a123fa0c6062570964011854302bbf57242 (diff) |
exportfs, oexportfs, iostats: 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.
oexportfs is changed to match exportfs.
oexportfs(4) is updated to reflect all changes.
The Synopsis is not changed due to the number of flags.
Removed -f from iostats.
iostats(4) is updated to reflect all changes.
---
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; |