Skip to content

Commit 723d224

Browse files
committed
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
1 parent d30c758 commit 723d224

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/libcore/rt/mod.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,10 @@ macro_rules! rtdebug_ (
1515
dumb_println(fmt!( $($arg),+ ));
1616

1717
fn dumb_println(s: &str) {
18-
use str::as_c_str;
19-
use libc::c_char;
20-
21-
extern {
22-
fn printf(s: *c_char);
23-
}
24-
25-
do as_c_str(s.to_str() + "\n") |s| {
26-
unsafe { printf(s); }
27-
}
18+
use io::WriterUtil;
19+
let dbg = ::libc::STDERR_FILENO as ::io::fd_t;
20+
dbg.write_str(s);
21+
dbg.write_str("\n");
2822
}
2923

3024
} )

0 commit comments

Comments
 (0)