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

ruby-changes:31359

From: nobu <ko1@a...>
Date: Sun, 27 Oct 2013 10:38:24 +0900 (JST)
Subject: [ruby-changes:31359] nobu:r43438 (trunk): process.c: Process::Tms

nobu	2013-10-27 10:38:20 +0900 (Sun, 27 Oct 2013)

  New Revision: 43438

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

  Log:
    process.c: Process::Tms
    
    * process.c (Init_process): rename Struct::Tms as Process::Tms.  keep
      the former defined for the backward compatibility, for the time
      being.

  Modified files:
    trunk/process.c
Index: process.c
===================================================================
--- process.c	(revision 43437)
+++ process.c	(revision 43438)
@@ -6630,9 +6630,9 @@ get_clk_tck(void) https://github.com/ruby/ruby/blob/trunk/process.c#L6630
 
 /*
  *  call-seq:
- *     Process.times   -> aStructTms
+ *     Process.times   -> aProcessTms
  *
- *  Returns a <code>Tms</code> structure (see <code>Struct::Tms</code>)
+ *  Returns a <code>Tms</code> structure (see <code>Process::Tms</code>)
  *  that contains user and system CPU times for this process,
  *  and also for children processes.
  *
@@ -7615,7 +7615,8 @@ Init_process(void) https://github.com/ruby/ruby/blob/trunk/process.c#L7615
     rb_define_module_function(rb_mProcess, "clock_getres", rb_clock_getres, -1);
 
 #if defined(HAVE_TIMES) || defined(_WIN32)
-    rb_cProcessTms = rb_struct_define("Tms", "utime", "stime", "cutime", "cstime", NULL);
+    rb_cProcessTms = rb_struct_define_under(rb_mProcess, "Tms", "utime", "stime", "cutime", "cstime", NULL);
+    rb_define_const(rb_cStruct, "Tms", rb_cProcessTms); /* for the backward compatibility */
 #endif
 
     SAVED_USER_ID = geteuid();

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

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