From 8e11ff283f1e7c36b23e6e52c2ab0ca12a7713f9 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Fri, 13 Jul 2012 15:09:39 +0200 Subject: 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. --- sys/src/cmd/cwfs/console.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'sys/src/cmd/cwfs/console.c') 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); -- cgit v1.2.3