summaryrefslogtreecommitdiff
path: root/ext/pty
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-11-27 10:00:35 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-11-27 10:00:35 +0000
commit186c8b592a8b5badfd42ff7295c5edb44ef1abdd (patch)
tree922c6ba9baaf7b140efadfb387c0a0780e544eb6 /ext/pty
parent09a4937b2fcf883fa57af1dfa5d12f605f812970 (diff)
* marshal.c (w_float): must distinguish -0.0 from 0.0.
* gc.c (gc_mark_all): tweak mark order for little bit better scan. * gc.c (rb_gc_mark): ditto. * gc.c (rb_gc): ditto. * enum.c (sort_by_i): slight performance boost. * gc.c (gc_mark_rest): should call gc_mark_children(), not gc_mark(). * gc.c (rb_gc_mark): may cause infinite looop. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/pty')
-rw-r--r--ext/pty/extconf.rb2
-rw-r--r--ext/pty/pty.c10
2 files changed, 6 insertions, 6 deletions
diff --git a/ext/pty/extconf.rb b/ext/pty/extconf.rb
index 51a4bc7..ec35879 100644
--- a/ext/pty/extconf.rb
+++ b/ext/pty/extconf.rb
@@ -3,12 +3,12 @@ require 'mkmf'
if /mswin32|mingw/ !~ RUBY_PLATFORM
have_header("sys/stropts.h")
have_func("setresuid")
- $CFLAGS << "-DHAVE_DEV_PTMX" if /cygwin/ === RUBY_PLATFORM
have_header("libutil.h")
have_header("pty.h")
have_library("util", "openpty")
if have_func("openpty") or
have_func("_getpty") or
+ have_func("ptsname") or
have_func("ioctl")
create_makefile('pty')
end
diff --git a/ext/pty/pty.c b/ext/pty/pty.c
index 1760ebf..def44b6 100644
--- a/ext/pty/pty.c
+++ b/ext/pty/pty.c
@@ -349,7 +349,7 @@ getDevice(master,slave)
int i,j;
char MasterName[DEVICELEN];
-#ifdef HAVE_DEV_PTMX
+#ifdef HAVE_PTSNAME
char *pn;
void (*s)();
@@ -364,7 +364,7 @@ getDevice(master,slave)
if(unlockpt(i) != -1) {
if((pn = ptsname(i)) != NULL) {
if((j = open(pn, O_RDWR, 0)) != -1) {
-#if defined I_PUSH
+#if defined I_PUSH && !defined linux
if(ioctl(j, I_PUSH, "ptem") != -1) {
if(ioctl(j, I_PUSH, "ldterm") != -1) {
#endif
@@ -372,7 +372,7 @@ getDevice(master,slave)
*slave = j;
strcpy(SlaveName, pn);
return;
-#if defined I_PUSH
+#if defined I_PUSH && !defined linux
}
}
#endif
@@ -385,10 +385,10 @@ getDevice(master,slave)
rb_raise(rb_eRuntimeError, "Cannot get Master/Slave device");
#else
for (p = deviceNo; *p != NULL; p++) {
- sprintf(MasterName ,MasterDevice,*p);
+ sprintf(MasterName,MasterDevice,*p);
if ((i = open(MasterName,O_RDWR,0)) >= 0) {
*master = i;
- sprintf(SlaveName ,SlaveDevice,*p);
+ sprintf(SlaveName,SlaveDevice,*p);
if ((j = open(SlaveName,O_RDWR,0)) >= 0) {
*slave = j;
chown(SlaveName, getuid(), getgid());