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/srv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/src/cmd/cwfs/srv.c') diff --git a/sys/src/cmd/cwfs/srv.c b/sys/src/cmd/cwfs/srv.c index 69f314383..813ac8337 100644 --- a/sys/src/cmd/cwfs/srv.c +++ b/sys/src/cmd/cwfs/srv.c @@ -36,7 +36,7 @@ chanhangup(Chan *chan, char *msg) if(chan == cons.chan || srv == nil || srv->chan != chan) return; if(msg[0] && chatty) - print("hangup %s: %s\n", chan->whochan, msg); + fprint(2, "hangup %s: %s\n", chan->whochan, msg); if(fd2path(srv->fd, buf, sizeof(buf)) == 0){ if(p = strrchr(buf, '/')){ strecpy(p, buf+sizeof(buf), "/ctl"); @@ -61,7 +61,7 @@ srvput(Srv *srv) chan = srv->chan; fileinit(chan); if(chatty) - print("%s closed\n", chan->whochan); + fprint(2, "%s closed\n", chan->whochan); lock(&freechans); srv->chan = freechans.hd; freechans.hd = chan; -- cgit v1.2.3