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

ruby-changes:33587

From: usa <ko1@a...>
Date: Tue, 22 Apr 2014 22:19:24 +0900 (JST)
Subject: [ruby-changes:33587] usa:r45668 (trunk): * file.c (rb_io_statfs): need to define even if the system doesn't have

usa	2014-04-22 22:19:15 +0900 (Tue, 22 Apr 2014)

  New Revision: 45668

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

  Log:
    * file.c (rb_io_statfs): need to define even if the system doesn't have
      fstatfs(2).
    
    * test/ruby/test_file.rb (TestFile#test_statfs): skip if IO#stafs is not
      implemented.

  Modified files:
    trunk/ChangeLog
    trunk/file.c
    trunk/test/ruby/test_file.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 45667)
+++ ChangeLog	(revision 45668)
@@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Apr 22 22:15:51 2014  NAKAMURA Usaku  <usa@r...>
+
+	* file.c (rb_io_statfs): need to define even if the system doesn't have
+	  fstatfs(2).
+
+	* test/ruby/test_file.rb (TestFile#test_statfs): skip if IO#stafs is not
+	  implemented.
+
 Tue Apr 22 19:32:48 2014  NARUSE, Yui  <naruse@r...>
 
 	* file.c: newly added a class File::Statfs. (experimental)
Index: test/ruby/test_file.rb
===================================================================
--- test/ruby/test_file.rb	(revision 45667)
+++ test/ruby/test_file.rb	(revision 45668)
@@ -385,6 +385,7 @@ class TestFile < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_file.rb#L385
   end
 
   def test_statfs
+    skip "not implemented" unless $stdout.respond_to?(:statfs)
     open(__FILE__) do |f|
       st = f.statfs
       assert_kind_of File::Statfs, st
Index: file.c
===================================================================
--- file.c	(revision 45667)
+++ file.c	(revision 45668)
@@ -1125,6 +1125,8 @@ rb_io_statfs(VALUE obj) https://github.com/ruby/ruby/blob/trunk/file.c#L1125
     }
     return rb_statfs_new(&st);
 }
+#else
+#define rb_io_statfs rb_f_notimplement
 #endif
 
 static int

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

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