Permalink
Browse files

* io.c (rb_write_error2): get rid of warning on linux. fwrite

  of glibc is tagged __attribute__ ((__warn_unused_result__))
  if _FORTIFY_SOURCE != 0.
* vm_dump.c (rb_vm_bugreport): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
1 parent 9b58c2e commit 8cee31214df54281a93c8fe135a5fd36fd7e288a @kosaki kosaki committed Nov 27, 2011
Showing with 11 additions and 2 deletions.
  1. +7 −0 ChangeLog
  2. +2 −1 io.c
  3. +2 −1 vm_dump.c
View
7 ChangeLog
@@ -1,3 +1,10 @@
+Sun Nov 27 20:58:02 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * io.c (rb_write_error2): get rid of warning on linux. fwrite
+ of glibc is tagged __attribute__ ((__warn_unused_result__))
+ if _FORTIFY_SOURCE != 0.
+ * vm_dump.c (rb_vm_bugreport): ditto.
+
Sun Nov 27 19:09:02 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (stack_protector): disable on mingw. [Bug#5676]
View
3 io.c
@@ -6596,7 +6596,8 @@ void
rb_write_error2(const char *mesg, long len)
{
if (rb_stderr == orig_stderr || RFILE(orig_stderr)->fptr->fd < 0) {
- (void)fwrite(mesg, sizeof(char), len, stderr);
+ int unused;
+ unused = fwrite(mesg, sizeof(char), len, stderr);
}
else {
rb_io_write(rb_stderr, rb_str_new(mesg, len));
View
3 vm_dump.c
@@ -863,7 +863,8 @@ rb_vm_bugreport(void)
while (!feof(fp)) {
char buff[0x100];
size_t rn = fread(buff, 1, 0x100, fp);
- fwrite(buff, 1, rn, stderr);
+ if (fwrite(buff, 1, rn, stderr) != rn)
+ break;
}
fclose(fp);

0 comments on commit 8cee312

Please sign in to comment.