diff options
Diffstat (limited to 'src/pkg/runtime/print.c')
-rw-r--r-- | src/pkg/runtime/print.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/pkg/runtime/print.c b/src/pkg/runtime/print.c index 4a358a811..15cffdfd4 100644 --- a/src/pkg/runtime/print.c +++ b/src/pkg/runtime/print.c @@ -26,7 +26,7 @@ dump(byte *p, int32 n) void prints(int8 *s) { - write(1, s, findnull((byte*)s)); + write(fd, s, findnull((byte*)s)); } // Very simple printf. Only for debugging prints. @@ -45,7 +45,7 @@ printf(int8 *s, ...) if(*p != '%') continue; if(p > lp) - write(1, lp, p-lp); + write(fd, lp, p-lp); p++; narg = nil; switch(*p) { @@ -98,7 +98,7 @@ printf(int8 *s, ...) lp = p+1; } if(p > lp) - write(1, lp, p-lp); + write(fd, lp, p-lp); // unlock(&debuglock); } @@ -115,10 +115,10 @@ void sys·printbool(bool v) { if(v) { - write(1, (byte*)"true", 4); + write(fd, (byte*)"true", 4); return; } - write(1, (byte*)"false", 5); + write(fd, (byte*)"false", 5); } void @@ -129,15 +129,15 @@ sys·printfloat(float64 v) float64 h; if(isNaN(v)) { - write(1, "NaN", 3); + write(fd, "NaN", 3); return; } if(isInf(v, 0)) { - write(1, "+Inf", 4); + write(fd, "+Inf", 4); return; } if(isInf(v, -1)) { - write(1, "+Inf", 4); + write(fd, "+Inf", 4); return; } @@ -196,7 +196,7 @@ sys·printfloat(float64 v) buf[n+4] = (e/100) + '0'; buf[n+5] = (e/10)%10 + '0'; buf[n+6] = (e%10) + '0'; - write(1, buf, n+7); + write(fd, buf, n+7); } void @@ -211,14 +211,14 @@ sys·printuint(uint64 v) break; v = v/10; } - write(1, buf+i, nelem(buf)-i); + write(fd, buf+i, nelem(buf)-i); } void sys·printint(int64 v) { if(v < 0) { - write(1, "-", 1); + write(fd, "-", 1); v = -v; } sys·printuint(v); @@ -238,7 +238,7 @@ sys·printhex(uint64 v) buf[--i] = '0'; buf[--i] = 'x'; buf[--i] = '0'; - write(1, buf+i, nelem(buf)-i); + write(fd, buf+i, nelem(buf)-i); } void @@ -253,21 +253,21 @@ sys·printstring(String v) extern int32 maxstring; if(v.len > maxstring) { - write(1, "[invalid string]", 16); + write(fd, "[invalid string]", 16); return; } if(v.len > 0) - write(1, v.str, v.len); + write(fd, v.str, v.len); } void sys·printsp(void) { - write(1, " ", 1); + write(fd, " ", 1); } void sys·printnl(void) { - write(1, "\n", 1); + write(fd, "\n", 1); } |