summaryrefslogtreecommitdiff
path: root/sys/src/cmd/cwfs/mworm.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2012-07-13 15:09:39 +0200
committercinap_lenrek <cinap_lenrek@gmx.de>2012-07-13 15:09:39 +0200
commit8e11ff283f1e7c36b23e6e52c2ab0ca12a7713f9 (patch)
tree21ae354f7121d196046b6b9c36a18232afb38e43 /sys/src/cmd/cwfs/mworm.c
parent53f5bdfd06cce8093de005b8d706b752d3567cfa (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/mworm.c')
-rw-r--r--sys/src/cmd/cwfs/mworm.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/src/cmd/cwfs/mworm.c b/sys/src/cmd/cwfs/mworm.c
index 407ad6a09..75159afc5 100644
--- a/sys/src/cmd/cwfs/mworm.c
+++ b/sys/src/cmd/cwfs/mworm.c
@@ -57,7 +57,7 @@ mcatread(Device *d, Off b, void *c)
return devread(x, b-l, c);
l += m;
}
- print("mcatread past end: %Z block %lld, %lld beyond end\n",
+ fprint(2, "mcatread past end: %Z block %lld, %lld beyond end\n",
d, (Wideoff)b, (Wideoff)l);
return 1;
}
@@ -79,7 +79,7 @@ mcatwrite(Device *d, Off b, void *c)
return devwrite(x, b-l, c);
l += m;
}
- print("mcatwrite past end: %Z block %lld, %lld beyond end\n",
+ fprint(2, "mcatwrite past end: %Z block %lld, %lld beyond end\n",
d, (Wideoff)b, (Wideoff)l);
return 1;
}
@@ -176,7 +176,7 @@ partread(Device *d, Off b, void *c)
size = l*100;
if(b < size)
return devread(d->part.d, base+b, c);
- print("partread past end: %Z blk %lld size %lld\n",
+ fprint(2, "partread past end: %Z blk %lld size %lld\n",
d, (Wideoff)b, (Wideoff)size);
return 1;
}
@@ -193,7 +193,7 @@ partwrite(Device *d, Off b, void *c)
size = l*100;
if(b < size)
return devwrite(d->part.d, base+b, c);
- print("partwrite past end: %Z blk %lld size %lld\n",
+ fprint(2, "partwrite past end: %Z blk %lld size %lld\n",
d, (Wideoff)b, (Wideoff)size);
return 1;
}
@@ -239,7 +239,7 @@ mirrread(Device *d, Off b, void *c)
Device *x;
if (d->cat.first == nil) {
- print("mirrread: empty mirror %Z\n", d);
+ fprint(2, "mirrread: empty mirror %Z\n", d);
return 1;
}
for(x=d->cat.first; x; x=x->link) {
@@ -249,7 +249,7 @@ mirrread(Device *d, Off b, void *c)
return 0;
}
// DANGER WILL ROBINSON
- print("mirrread: all mirrors of %Z block %lld are bad\n",
+ fprint(2, "mirrread: all mirrors of %Z block %lld are bad\n",
d, (Wideoff)b);
return 1;
}
@@ -268,7 +268,7 @@ ewrite(Device *x, Off b, void *c)
if(x->size == 0)
x->size = devsize(x);
if (devwrite(x, b, c) != 0) {
- print("mirrwrite: error at %Z block %lld\n", x, (Wideoff)b);
+ fprint(2, "mirrwrite: error at %Z block %lld\n", x, (Wideoff)b);
return 1;
}
return 0;
@@ -289,7 +289,7 @@ int
mirrwrite(Device *d, Off b, void *c)
{
if (d->cat.first == nil) {
- print("mirrwrite: empty mirror %Z\n", d);
+ fprint(2, "mirrwrite: empty mirror %Z\n", d);
return 1;
}
return wrmirrs1st(d->cat.first, b, c);