[前][次][番号順一覧][スレッド一覧]

ruby-changes:21845

From: nobu <ko1@a...>
Date: Tue, 29 Nov 2011 09:59:16 +0900 (JST)
Subject: [ruby-changes:21845] nobu:r33894 (trunk): * io.c (rb_write_error2): suppress unused variable warning.

nobu	2011-11-29 09:58:28 +0900 (Tue, 29 Nov 2011)

  New Revision: 33894

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=33894

  Log:
    * io.c (rb_write_error2): suppress unused variable warning.

  Modified files:
    trunk/ChangeLog
    trunk/io.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 33893)
+++ ChangeLog	(revision 33894)
@@ -1,3 +1,7 @@
+Tue Nov 29 09:58:23 2011  Nobuyoshi Nakada  <nobu@r...>
+
+	* io.c (rb_write_error2): suppress unused variable warning.
+
 Tue Nov 29 07:45:26 2011  Eric Hodel  <drbrain@s...>
 
 	* lib/mkmf.rb:  Wrap comments to 78 columns and clean up formatting.
@@ -12,11 +16,11 @@
 Tue Nov 29 00:08:57 2011  Yuki Sonoda (Yugui)  <yugui@y...>
 
 	* common.mk (INSTRUBY_ARGS): added --mantype to apply mdoc2man.rb
-	  to man pages.  Fixes #5598. 
+	  to man pages.  Fixes #5598.
 	  (do-install-nodoc, do-install-local, do-install-man,
 	  dont-install-nodoc, dont-install-local, dont-install-man):
 	  No longer needs --mantype.
-	
+
 	  Reported by Rainer Orth <ro AT cebitec.uni-bielefeld.de>,
 	  patch by George Koehler <xkernigh AT netscape.net>.
 
Index: io.c
===================================================================
--- io.c	(revision 33893)
+++ io.c	(revision 33894)
@@ -6599,8 +6599,10 @@
 rb_write_error2(const char *mesg, long len)
 {
     if (rb_stderr == orig_stderr || RFILE(orig_stderr)->fptr->fd < 0) {
-	ssize_t unused;
-	unused = fwrite(mesg, sizeof(char), len, stderr);
+	if (fwrite(mesg, sizeof(char), (size_t)len, stderr) < (size_t)len) {
+	    /* failed to write to stderr, what can we do? */
+	    return;
+	}
     }
     else {
 	rb_io_write(rb_stderr, rb_str_new(mesg, len));

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]