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

ruby-changes:12345

From: yugui <ko1@a...>
Date: Sun, 12 Jul 2009 22:57:24 +0900 (JST)
Subject: [ruby-changes:12345] Ruby:r24040 (ruby_1_9_1): merges r23861 from trunk into ruby_1_9_1.

yugui	2009-07-12 22:57:08 +0900 (Sun, 12 Jul 2009)

  New Revision: 24040

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

  Log:
    merges r23861 from trunk into ruby_1_9_1.
    --
    * ext/pty/pty.c (pty_getpty): check dup failure.

  Modified files:
    branches/ruby_1_9_1/ChangeLog
    branches/ruby_1_9_1/ext/pty/pty.c
    branches/ruby_1_9_1/version.h

Index: ruby_1_9_1/ChangeLog
===================================================================
--- ruby_1_9_1/ChangeLog	(revision 24039)
+++ ruby_1_9_1/ChangeLog	(revision 24040)
@@ -1,3 +1,7 @@
+Fri Jun 26 21:48:30 2009  Tanaka Akira  <akr@f...>
+
+	* ext/pty/pty.c (pty_getpty): check dup failure.
+
 Thu Jun 25 17:58:39 2009  Yukihiro Matsumoto  <matz@r...>
 
 	* io.c (argf_binmode_m): should call rb_io_ascii8bit_binmode() to
Index: ruby_1_9_1/ext/pty/pty.c
===================================================================
--- ruby_1_9_1/ext/pty/pty.c	(revision 24039)
+++ ruby_1_9_1/ext/pty/pty.c	(revision 24040)
@@ -425,7 +425,27 @@
     return;
 }
 
-/* ruby function: getpty */
+/*
+ * call-seq:
+ *   PTY.spawn(command...) {|r, w, pid| ... }   => nil
+ *   PTY.spawn(command...)                      => r, w, pid
+ *   PTY.getpty(command...) {|r, w, pid| ... }  => nil
+ *   PTY.getpty(command...)                     => r, w, pid
+ *
+ * spawns the specified command on a newly allocated pty.
+ *
+ * The command's controlling tty is set to the slave device of the pty.
+ * Also its standard input/output/error is redirected to the slave device.
+ *
+ * PTY.spawn returns two IO objects and PID.
+ * PID is the process ID of the command.
+ * The two IO objects are connected to the master device of the pty.
+ * The first IO object is opened as read mode and
+ * The second is opened as write mode.
+ *
+ * If a block is given, two IO objects and PID is yielded.
+ *
+ */
 static VALUE
 pty_getpty(int argc, VALUE *argv, VALUE self)
 {
@@ -448,6 +468,8 @@
 
     wfptr->mode = rb_io_mode_flags("w") | FMODE_SYNC;
     wfptr->fd = dup(info.fd);
+    if (wfptr->fd == -1)
+        rb_sys_fail("dup()");
     wfptr->pathv = rfptr->pathv;
 
     res = rb_ary_new2(3);
Index: ruby_1_9_1/version.h
===================================================================
--- ruby_1_9_1/version.h	(revision 24039)
+++ ruby_1_9_1/version.h	(revision 24040)
@@ -1,6 +1,6 @@
 #define RUBY_VERSION "1.9.1"
 #define RUBY_RELEASE_DATE "2009-06-25"
-#define RUBY_PATCHLEVEL 206
+#define RUBY_PATCHLEVEL 207
 #define RUBY_VERSION_MAJOR 1
 #define RUBY_VERSION_MINOR 9
 #define RUBY_VERSION_TEENY 1

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

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