]> code.delx.au - gnu-emacs/commitdiff
* s/darwin.h: Removed PTY_ITERATION from here.
authorSteven Tamm <steventamm@mac.com>
Sat, 22 Jan 2005 15:54:04 +0000 (15:54 +0000)
committerSteven Tamm <steventamm@mac.com>
Sat, 22 Jan 2005 15:54:04 +0000 (15:54 +0000)
(DARWIN): Defined.
* process.c (init_process): Default process-connection-type to
nil on darwin 6 or less, t if it is 7 or higher.  This way the
broken pty behavior is still allowed on darwin 6 for interactive
processes for people that know what they are doing.

src/ChangeLog
src/process.c
src/s/darwin.h

index 00f8e15aff2cb712f52fbf81560acce0dc7d2d49..8cf79218c3e444942214af20afadc6fd592243e2 100644 (file)
@@ -1,3 +1,12 @@
+2005-01-22  Steven Tamm  <steventamm@mac.com>
+
+       * s/darwin.h: Removed PTY_ITERATION from here.
+       (DARWIN): Defined.
+       * process.c (init_process): Default process-connection-type to
+       nil on darwin 6 or less, t if it is 7 or higher.  This way the
+       broken pty behavior is still allowed on darwin 6 for interactive
+       processes for people that know what they are doing.
+
 2005-01-22  Kim F. Storm  <storm@cua.dk>
 
        * window.c (auto_window_vscroll_p): New boolean.
index 6134d3131bc571b435af6a8b47b0ac320eb31fe6..9b8b086ec7ec12ab7652219dc069fad681c700d8 100644 (file)
@@ -187,6 +187,7 @@ extern Lisp_Object QCfilter;
 #include "syswait.h"
 
 extern void set_waiting_for_input P_ ((EMACS_TIME *));
+extern char *get_operating_system_release ();
 
 #ifndef USE_CRT_DLL
 extern int errno;
@@ -6704,6 +6705,19 @@ init_process ()
    Fprovide (intern ("make-network-process"), subfeatures);
  }
 #endif /* HAVE_SOCKETS */
+
+#ifdef DARWIN
+  /* PTYs are broken on Darwin < 6, but are sometimes useful for interactive 
+     processes.  As such, we only change the default value.  */
+ if (initialized)
+  {
+    char *release = get_operating_system_release();
+    if (!release || !release[0] || (release[0] < MIN_PTY_KERNEL_VERSION
+                                   && release[1] == '.')) {
+      Vprocess_connection_type = Qnil;
+    }
+  }
+#endif
 }
 
 void
index d8da3e3174c60eb7032267697c5c6d206606b01b..5b162ea08a35330e80f858e6bb6eca06bbb5b577 100644 (file)
@@ -37,6 +37,10 @@ Boston, MA 02111-1307, USA.  */
 #define BSD_SYSTEM
 /* #define VMS */
 
+#ifndef        DARWIN
+#define        DARWIN 1
+#endif
+
 /* MAC_OS is used to conditionally compile code common to both MAC_OS8
    and MAC_OSX.  */
 #ifdef MAC_OSX
@@ -103,25 +107,17 @@ Boston, MA 02111-1307, USA.  */
 
 /*
  *     Define HAVE_PTYS if the system supports pty devices.
+ *      Note: PTYs are broken on darwin <6.  Use at your own risk.
  */
 
 #define HAVE_PTYS
 
-
-/*
- * PTYs only work correctly on Darwin 7 or higher.  So make PTY_ITERATION
- * Test the operating system release and only allow PTYs if it is greater
- * than 7.
+/**
+ * PTYs only work correctly on Darwin 7 or higher.  So make the
+ * default for process-connection-type dependent on the kernel
+ * version.
  */
 #define MIN_PTY_KERNEL_VERSION '7' 
-#define PTY_ITERATION  \
-  char *release = get_operating_system_release();      \
-  if (!release || !release[0] || (release[0] < MIN_PTY_KERNEL_VERSION \
-                                 && release[1] == '.'))              \
-    return -1; \
-  for (c = FIRST_PTY_LETTER; c <= 'z'; c++)    \
-    for (i = 0; i < 16; i++)
-
 
 /*
  *     Define NONSYSTEM_DIR_LIBRARY to make Emacs emulate