[#41918] [Feature #3647] Array#sample(n, replace=false) — Kenta Murata <redmine@...>

Feature #3647: Array#sample(n, replace=false)

11 messages 2010/08/03

[#41966] [Bug #3673] PTY.getpty with IO.pipe doesn't finish on FreeBSD — Yui NARUSE <redmine@...>

Bug #3673: PTY.getpty with IO.pipe doesn't finish on FreeBSD

9 messages 2010/08/10

[#41969] [Feature #3675] String#prepend, String#>> — Sora Harakami <redmine@...>

Feature #3675: String#prepend, String#>>

15 messages 2010/08/10
[#41976] Re: [Feature #3675] String#prepend, String#>> — Yukihiro Matsumoto <matz@...> 2010/08/10

まつもと ゆきひろです

[#41974] Re: [ruby-cvs:36157] Ruby:r28955 (trunk): * complex.c (nucomp_to_[ifr]): don't allow complex with in-exact — Yukihiro Matsumoto <matz@...>

まつもと ゆきひろです

7 messages 2010/08/10

[#42003] WEBrickに関するセキュリティ修正 (CVE-2010-0541) — Hideki Yamane <henrich@...>

12 messages 2010/08/11

[#42090] Math::atan2(0, 0) on ruby 1.9.2 — KUBO Takehiro <kubo@...>

久保です。

18 messages 2010/08/22
[#42092] Re: Math::atan2(0, 0) on ruby 1.9.2 — Kenta Murata <muraken@...> 2010/08/22

=1B$B$`$i$?$G$9!#=1B(B

[#42166] Ruby'sライセンスの、BSDLとのデュアルライセンスへの変更 — "NARUSE, Yui" <naruse@...>

Ruby's ライセンスは BSDL と Ruby's のデュアルライセンスになります。

14 messages 2010/08/31

[ruby-dev:42034] [Bug #3673] PTY.getpty with IO.pipe doesn't finish on FreeBSD

From: Yui NARUSE <redmine@...>
Date: 2010-08-14 10:55:45 UTC
List: ruby-dev #42034
チケット #3673 が更新されました。 (by Yui NARUSE)


まずはテストの修正ありがとうございます。

確かに以下の通り close(2) の前にエコーによって出力された文字列を読んであげるとちゃんと閉じられますね。
うーん、前の Bug #3515 と関係あるのかなぁ。

#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/wait.h>
#include <termios.h>

int main(int argc, char *argv[])
{
      int m, s;
      char *slavedev;
      struct termios t;

      if ((m = posix_openpt(O_RDWR|O_NOCTTY)) == -1) {
          perror("posix_openpt"); exit(1); }
      if (grantpt(m) == -1) { perror("grantpt"); exit(1); }
      if (unlockpt(m) == -1) { perror("unlockpt"); exit(1); }
      if ((slavedev = ptsname(m)) == NULL) { perror("ptsname"); exit(1); }
      if ((s = open(slavedev, O_RDWR|O_NOCTTY, 0)) == -1) {
          perror("open(slavedev)"); exit(1); }

      if (tcgetattr(s, &t) == -1) { perror("tcgetattr"); }
      t.c_lflag &= ~(tcflag_t)(ECHO|ECHOE|ECHOK|ECHONL);
      //if (tcsetattr(s, TCSANOW, &t) == -1) { perror("tcsetattr"); }

      if (write(m, "a", 1) == -1) { perror("write"); exit(1); }

      {
          char buf[100];
          if (read(m, buf, 1) == -1) { perror("write"); exit(1); }
          printf("echo: %c\n", buf[0]);
      }

      if (close(s) == -1) { perror("close"); exit(1); }

      return 0;
}

----------------------------------------
http://redmine.ruby-lang.org/issues/show/3673

----------------------------------------
http://redmine.ruby-lang.org

In This Thread