summaryrefslogtreecommitdiff
path: root/error.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-13 05:53:08 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-13 05:53:08 +0000
commit5e8a9873a2c7d40444af807d3a5aa374a2514d48 (patch)
tree745346f9649eea9b45247f7f2d66796305178792 /error.c
parente44e2ef2e84012bd842228c8b86de776a9a334d6 (diff)
* eval.c (error_pos): use $deferr for output instead of stderr
directly. * eval.c (error_print,error_handle,rb_longjmp,rb_thread_schedule): ditto. * io.c (Init_IO): new variable $deferr which is default output port of error messages. * io.c (rb_warn_m): new method "warn". [new] * error.c (warn_print): use $deferr. * error.c (rb_bug): ditto. * error.c (err_append): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'error.c')
-rw-r--r--error.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/error.c b/error.c
index e0c91f6746..ce7800d07c 100644
--- a/error.c
+++ b/error.c
@@ -106,9 +106,8 @@ warn_print(fmt, args)
char buf[BUFSIZ];
err_snprintf(buf, BUFSIZ, fmt, args);
- fputs(buf, stderr);
- fputs("\n", stderr);
- fflush(stderr);
+ rb_write_deferr(buf);
+ rb_write_deferr("\n");
}
void
@@ -170,7 +169,9 @@ rb_bug(fmt, va_alist)
va_init_list(args, fmt);
warn_print(buf, args);
va_end(args);
- fprintf(stderr, "ruby %s (%s) [%s]\n", RUBY_VERSION, RUBY_RELEASE_DATE, RUBY_PLATFORM);
+ snprintf(buf, BUFSIZ, "ruby %s (%s) [%s]\n", RUBY_VERSION, RUBY_RELEASE_DATE, RUBY_PLATFORM);
+ rb_write_deferr(buf);
+ rb_write_deferr("\n");
abort();
}
@@ -1124,8 +1125,7 @@ err_append(s)
}
}
else {
- fputs(s, stderr);
- fputs("\n", stderr);
- fflush(stderr);
+ rb_write_deferr(s);
+ rb_write_deferr("\n");
}
}