[#42735] [Ruby 1.9-Feature#4147][Open] Array#sample で重みを指定したい — Yoji Ojima <redmine@...>

Feature #4147: Array#sample で重みを指定したい

52 messages 2010/12/10
[#42791] [Ruby 1.9-Feature#4147][Assigned] Array#sample で重みを指定したい — Shyouhei Urabe <redmine@...> 2010/12/18

チケット #4147 が更新されました。 (by Shyouhei Urabe)

[#42800] Re: [Ruby 1.9-Feature#4147][Assigned] Array#sample で重みを指定したい — Masaya TARUI <tarui@...> 2010/12/19

> じゃあ反対ないので実装はともかく、この仕様は基本入れる方向で考えましょう。反対の人は意思表示お早めに。

[#42763] [Ruby 1.9-Bug#4159][Open] test_block_variables(TestRipper::ParserEvents) が失敗する — Kouhei Yanagita <redmine@...>

Bug #4159: test_block_variables(TestRipper::ParserEvents) が失敗する

8 messages 2010/12/14

[#42894] [Ruby 1.8-Feature#4207][Open] これから「1.8.8」の話をしよう -- 1.8がこの先生きのこるには — Shyouhei Urabe <redmine@...>

Feature #4207: これから「1.8.8」の話をしよう -- 1.8がこの先生きのこるには

24 messages 2010/12/26
[#42935] Re: [Ruby 1.8-Feature#4207][Open] これから「1.8.8」の話をしよう -- 1.8がこの先生きのこるには — Kenta Murata <muraken@...> 2011/01/04

むらたです。

[#42936] Re: [Ruby 1.8-Feature#4207][Open] これから「1.8.8」の話をしよう -- 1.8がこの先生きのこるには — Kenta Murata <muraken@...> 2011/01/05

むらたです。

[ruby-dev:42667] Re: Errno::EINTR: Interrupted system call on console#echo=

From: SASADA Koichi <ko1@...>
Date: 2010-12-01 14:38:55 UTC
List: ruby-dev #42667
(2010/12/01 23:13), SASADA Koichi wrote:
>  現実的にはほぼ無さそうなんですが、setattr()(tcsetattr()) が EINTR を
> 返す可能性が、無くはないようです。どういうシチュエーションだろう。

 こうかな。

Index: ext/io/console/console.c
===================================================================
--- ext/io/console/console.c	(revision 29985)
+++ ext/io/console/console.c	(working copy)
@@ -26,7 +26,16 @@
 #if defined HAVE_TERMIOS_H
 # include <termios.h>
 typedef struct termios conmode;
-# define setattr(fd, t) (tcsetattr(fd, TCSAFLUSH, t) == 0)
+
+static int
+setattr(int fd, conmode *t)
+{
+    int r;
+  retry:
+    r = tcsetattr(fd, TCSAFLUSH, t);
+    if (r != 0 && errno == EINTR) goto retry;
+    return r == 0;
+}
 # define getattr(fd, t) (tcgetattr(fd, t) == 0)
 #elif defined HAVE_TERMIO_H
 # include <termio.h>


-- 
// SASADA Koichi at atdot dot net

In This Thread

Prev Next