summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-ruby/ruby-termios/files/ruby-termios-ruby19.patch')
-rw-r--r--dev-ruby/ruby-termios/files/ruby-termios-ruby19.patch87
1 files changed, 87 insertions, 0 deletions
diff --git a/dev-ruby/ruby-termios/files/ruby-termios-ruby19.patch b/dev-ruby/ruby-termios/files/ruby-termios-ruby19.patch
new file mode 100644
index 000000000000..97c631a986a6
--- /dev/null
+++ b/dev-ruby/ruby-termios/files/ruby-termios-ruby19.patch
@@ -0,0 +1,87 @@
+--- ruby-termios-0.9.4-/termios.c 2002-10-13 00:15:03.000000000 +0900
++++ ruby-termios-0.9.4/termios.c 2005-05-27 16:53:32.000000000 +0900
+@@ -12,6 +12,12 @@
+ #include <unistd.h>
+ #include <string.h>
+
++#ifdef GetReadFile
++#define GetFD(fptr) fileno(GetReadFile(fptr))
++#else
++#define GetFD(fptr) (fptr->fd)
++#endif
++
+ static VALUE mTermios;
+ static VALUE cTermios;
+ static VALUE tcsetattr_opt, tcflush_qs, tcflow_act;
+@@ -201,7 +207,7 @@
+
+ Check_Type(io, T_FILE);
+ GetOpenFile(io, fptr);
+- if (tcgetattr(fileno(fptr->f), &t) < 0) {
++ if (tcgetattr(GetFD(fptr), &t) < 0) {
+ rb_raise(rb_eRuntimeError,
+ "can't get terminal parameters (%s)", strerror(errno));
+ }
+@@ -243,7 +249,7 @@
+ old = termios_tcgetattr(io);
+ GetOpenFile(io, fptr);
+ Termios_to_termios(param, &t);
+- if (tcsetattr(fileno(fptr->f), tcsetattr_option, &t) < 0) {
++ if (tcsetattr(GetFD(fptr), tcsetattr_option, &t) < 0) {
+ rb_raise(rb_eRuntimeError,
+ "can't set terminal parameters (%s)", strerror(errno));
+ }
+@@ -268,7 +274,7 @@
+ Check_Type(duration, T_FIXNUM);
+
+ GetOpenFile(io, fptr);
+- if (tcsendbreak(fileno(fptr->f), FIX2INT(duration)) < 0) {
++ if (tcsendbreak(GetFD(fptr), FIX2INT(duration)) < 0) {
+ rb_raise(rb_eRuntimeError,
+ "can't transmits break (%s)", strerror(errno));
+ }
+@@ -292,7 +298,7 @@
+ Check_Type(io, T_FILE);
+
+ GetOpenFile(io, fptr);
+- if (tcdrain(fileno(fptr->f)) < 0) {
++ if (tcdrain(GetFD(fptr)) < 0) {
+ rb_raise(rb_eRuntimeError, "can't drain (%s)", strerror(errno));
+ }
+
+@@ -322,7 +328,7 @@
+ }
+
+ GetOpenFile(io, fptr);
+- if (tcflush(fileno(fptr->f), queue_selector) < 0) {
++ if (tcflush(GetFD(fptr), queue_selector) < 0) {
+ rb_raise(rb_eRuntimeError, "can't flush (%s)", strerror(errno));
+ }
+
+@@ -352,7 +358,7 @@
+ }
+
+ GetOpenFile(io, fptr);
+- if (tcflow(fileno(fptr->f), action) < 0) {
++ if (tcflow(GetFD(fptr), action) < 0) {
+ rb_raise(rb_eRuntimeError,
+ "can't control transmitting data flow (%s)", strerror(errno));
+ }
+@@ -376,7 +382,7 @@
+
+ Check_Type(io, T_FILE);
+ GetOpenFile(io, fptr);
+- if ((pid = tcgetpgrp(fileno(fptr->f))) < 0) {
++ if ((pid = tcgetpgrp(GetFD(fptr))) < 0) {
+ rb_raise(rb_eRuntimeError,
+ "can't get process group id (%s)", strerror(errno));
+ }
+@@ -401,7 +407,7 @@
+ Check_Type(pgrpid, T_FIXNUM);
+
+ GetOpenFile(io, fptr);
+- if (tcsetpgrp(fileno(fptr->f), FIX2INT(pgrpid)) < 0) {
++ if (tcsetpgrp(GetFD(fptr), FIX2INT(pgrpid)) < 0) {
+ rb_raise(rb_eRuntimeError,
+ "can't set process group id (%s)", strerror(errno));
+ }