diff options
| author | Brian Anderson <banderson@mozilla.com> | 2013-03-12 15:40:32 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2013-03-18 16:59:11 -0700 |
| commit | 723d2247c1e310a49dd49afc80e7c8a153bd1432 (patch) | |
| tree | ab07b2939179303c07d07086e881cf8f56a38ae7 | |
| parent | d30c75897416621092023063b885494f2a64e406 (diff) | |
| download | rust-723d2247c1e310a49dd49afc80e7c8a153bd1432.tar.gz rust-723d2247c1e310a49dd49afc80e7c8a153bd1432.zip | |
core: Don't use printf in rtdebug!
The bots were showing a segfault that I can't reproduce. Assuming it's varargs related so let's not use printf
| -rw-r--r-- | src/libcore/rt/mod.rs | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/libcore/rt/mod.rs b/src/libcore/rt/mod.rs index e48367d7202..556431e9315 100644 --- a/src/libcore/rt/mod.rs +++ b/src/libcore/rt/mod.rs @@ -15,16 +15,10 @@ macro_rules! rtdebug_ ( dumb_println(fmt!( $($arg),+ )); fn dumb_println(s: &str) { - use str::as_c_str; - use libc::c_char; - - extern { - fn printf(s: *c_char); - } - - do as_c_str(s.to_str() + "\n") |s| { - unsafe { printf(s); } - } + use io::WriterUtil; + let dbg = ::libc::STDERR_FILENO as ::io::fd_t; + dbg.write_str(s); + dbg.write_str("\n"); } } ) |
