diff options
author | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-07-13 15:09:39 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-07-13 15:09:39 +0200 |
commit | 8e11ff283f1e7c36b23e6e52c2ab0ca12a7713f9 (patch) | |
tree | 21ae354f7121d196046b6b9c36a18232afb38e43 /sys/src/cmd/cwfs/console.c | |
parent | 53f5bdfd06cce8093de005b8d706b752d3567cfa (diff) |
cwfs: make /srv/cwfs.cmd redable to receive command output
before, cwfs would print everything to /dev/cons. this change
will redirect the output of commands to the /srv/cwfs.cmd pipe
so one can use:
con -C /srv/cwfs.cmd
and not have the fish for the output in /dev/kmesg.
use standard error (/dev/cons) for unsolicited messages as
there is not always a reader on the command file.
Diffstat (limited to 'sys/src/cmd/cwfs/console.c')
-rw-r--r-- | sys/src/cmd/cwfs/console.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/src/cmd/cwfs/console.c b/sys/src/cmd/cwfs/console.c index fdfd77e68..e1bae4886 100644 --- a/sys/src/cmd/cwfs/console.c +++ b/sys/src/cmd/cwfs/console.c @@ -9,7 +9,7 @@ fcall9p1(Chan *cp, Fcall *in, Fcall *ou) rlock(&mainlock); t = in->type; if(t < 0 || t >= MAXSYSCALL || (t&1) || !call9p1[t]) { - print("bad message type %d\n", t); + fprint(2, "bad message type %d\n", t); panic(""); } ou->type = t+1; @@ -20,7 +20,7 @@ fcall9p1(Chan *cp, Fcall *in, Fcall *ou) runlock(&cp->reflock); if(ou->err && CHAT(cp)) - print("\terror: %s\n", errstr9p[ou->err]); + fprint(2, "\terror: %s\n", errstr9p[ou->err]); runlock(&mainlock); } @@ -205,8 +205,8 @@ f_fstat(Chan *cp, Fcall *in, Fcall *ou) int i; if(CHAT(cp)) { - print("c_fstat %d\n", cp->chan); - print("\tfid = %d\n", in->fid); + fprint(2, "c_fstat %d\n", cp->chan); + fprint(2, "\tfid = %d\n", in->fid); } p = 0; @@ -246,8 +246,8 @@ f_clri(Chan *cp, Fcall *in, Fcall *ou) File *f; if(CHAT(cp)) { - print("c_clri %d\n", cp->chan); - print("\tfid = %d\n", in->fid); + fprint(2, "c_clri %d\n", cp->chan); + fprint(2, "\tfid = %d\n", in->fid); } f = filep(cp, in->fid, 0); |