emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r109046: Move FIRST_PTY_LETTER, PTY_I


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r109046: Move FIRST_PTY_LETTER, PTY_ITERATION from src/s to configure
Date: Wed, 11 Jul 2012 23:34:40 -0700
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 109046
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Wed 2012-07-11 23:34:40 -0700
message:
  Move FIRST_PTY_LETTER, PTY_ITERATION from src/s to configure
  
  * configure.ac (FIRST_PTY_LETTER PTY_ITERATION): Move here from src/s.
  
  * src/s/aix4-2.h, src/s/bsd-common.h, src/s/cygwin.h, src/s/darwin.h:
  * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h, src/s/template.h:
  * src/s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
modified:
  ChangeLog
  configure.ac
  src/ChangeLog
  src/s/aix4-2.h
  src/s/bsd-common.h
  src/s/cygwin.h
  src/s/darwin.h
  src/s/gnu-linux.h
  src/s/hpux10-20.h
  src/s/irix6-5.h
  src/s/template.h
  src/s/usg5-4-common.h
=== modified file 'ChangeLog'
--- a/ChangeLog 2012-07-12 02:14:29 +0000
+++ b/ChangeLog 2012-07-12 06:34:40 +0000
@@ -5,7 +5,8 @@
 
        * configure.ac (NARROWPROTO, NO_ABORT, BROKEN_GET_CURRENT_DIR_NAME)
        (BROKEN_FIONREAD, BROKEN_PTY_READ_AFTER_EAGAIN, BROKEN_SIGAIO)
-       (BROKEN_SIGPOLL, BROKEN_SIGPTY, G_SLICE_ALWAYS_MALLOC, PREFER_VSUSP)
+       (BROKEN_SIGPOLL, BROKEN_SIGPTY, FIRST_PTY_LETTER)
+       (G_SLICE_ALWAYS_MALLOC, PREFER_VSUSP, PTY_ITERATION)
        (RUN_TIME_REMAP, SETPGRP_RELEASES_CTTY, TAB3, TABDLY, RUN_TIME_REMAP
        (XOS_NEEDS_TIME_H): Move here from src/s.
 

=== modified file 'configure.ac'
--- a/configure.ac      2012-07-12 02:14:29 +0000
+++ b/configure.ac      2012-07-12 06:34:40 +0000
@@ -3291,6 +3291,66 @@
 esac
 
 
+dnl Used in process.c, this must be a loop, even if it only runs once.
+dnl (Except on SGI; see below.  Take that, clarity and consistency!)
+AH_TEMPLATE(PTY_ITERATION, [How to iterate over PTYs.])
+dnl Only used if !PTY_ITERATION.  Iterate from FIRST_PTY_LETTER to z,
+dnl trying suffixes 0-16.
+AH_TEMPLATE(FIRST_PTY_LETTER, [Letter to use in finding device name of
+  first PTY, if PTYs are supported.])
+
+case $opsys in
+  aix4-2 )
+    AC_DEFINE(PTY_ITERATION, [int c; for (c = 0; !c ; c++)] )
+    ;;
+
+  cygwin )
+    AC_DEFINE(PTY_ITERATION, [int i; for (i = 0; i < 1; i++)] )
+    ;;
+
+  darwin )
+    AC_DEFINE(PTY_ITERATION, [int i; for (i = 0; i < 1; i++)] )
+    dnl Not used, because PTY_ITERATION is defined.
+    AC_DEFINE(FIRST_PTY_LETTER, ['p'])
+    ;;
+
+  gnu | hpux* | freebsd | netbsd | openbsd )
+    AC_DEFINE(FIRST_PTY_LETTER, ['p'])
+    ;;
+
+  gnu-linux | gnu-kfreebsd )
+    dnl if HAVE_GRANTPT
+    if test "x$ac_cv_func_grantpt" = xyes; then
+      AC_DEFINE(PTY_ITERATION, [int i; for (i = 0; i < 1; i++)] )
+    else
+      AC_DEFINE(FIRST_PTY_LETTER, ['p'])
+    fi
+    ;;
+
+  irix6-5 )
+    dnl It looks like this cannot be right, because it is not a loop.
+    dnl However, process.c actually does this:
+    dnl # ifndef __sgi
+    dnl   continue;
+    dnl # else
+    dnl   return -1;
+    dnl # endif
+    dnl which presumably makes it OK, since irix == sgi (?).
+    dnl FIXME it seems like this special treatment is unnecessary?
+    dnl Why can't irix use a single-trip loop like eg cygwin?
+    AC_DEFINE(PTY_ITERATION, [])
+    dnl Not used, because PTY_ITERATION is defined.
+    AC_DEFINE(FIRST_PTY_LETTER, ['q'])
+    ;;
+
+  sol2* | unixware )
+    dnl This change means that we don't loop through allocate_pty too
+    dnl many times in the (rare) event of a failure.
+    AC_DEFINE(FIRST_PTY_LETTER, ['z'])
+    ;;
+esac
+
+
 AH_TEMPLATE(SIGNALS_VIA_CHARACTERS, [Make process_send_signal work by
 "typing" a signal character on the pty.])
 

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-07-12 03:45:46 +0000
+++ b/src/ChangeLog     2012-07-12 06:34:40 +0000
@@ -1,3 +1,9 @@
+2012-07-12  Glenn Morris  <address@hidden>
+
+       * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
+       * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
+       * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
+
 2012-07-12  Dmitry Antipov  <address@hidden>
 
        Use empty_unibyte_string where applicable.

=== modified file 'src/s/aix4-2.h'
--- a/src/s/aix4-2.h    2012-07-12 02:14:29 +0000
+++ b/src/s/aix4-2.h    2012-07-12 06:34:40 +0000
@@ -28,7 +28,6 @@
 
 /* In AIX, you allocate a pty by opening /dev/ptc to get the master side.
    To get the name of the slave side, you just ttyname() the master side.  */
-#define PTY_ITERATION int c; for (c = 0; !c ; c++)
 #define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptc");
 #define PTY_TTY_NAME_SPRINTF strcpy (pty_name, ttyname (fd));
 

=== modified file 'src/s/bsd-common.h'
--- a/src/s/bsd-common.h        2012-07-12 01:49:28 +0000
+++ b/src/s/bsd-common.h        2012-07-12 06:34:40 +0000
@@ -36,6 +36,3 @@
 
 /* For mem-limits.h.  */
 #define BSD4_2
-
-/* First pty name is /dev/ptyp0.  */
-#define FIRST_PTY_LETTER 'p'

=== modified file 'src/s/cygwin.h'
--- a/src/s/cygwin.h    2012-07-12 02:14:29 +0000
+++ b/src/s/cygwin.h    2012-07-12 06:34:40 +0000
@@ -17,7 +17,6 @@
 You should have received a copy of the GNU General Public License
 along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#define PTY_ITERATION          int i; for (i = 0; i < 1; i++) /* ick */
 #define PTY_NAME_SPRINTF       /* none */
 #define PTY_TTY_NAME_SPRINTF   /* none */
 #define PTY_OPEN                                       \

=== modified file 'src/s/darwin.h'
--- a/src/s/darwin.h    2012-07-12 01:49:28 +0000
+++ b/src/s/darwin.h    2012-07-12 06:34:40 +0000
@@ -30,12 +30,6 @@
    distinguish OS X from pure Darwin.  */
 #define DARWIN_OS
 
-/* Letter to use in finding device name of first pty,
-  if system supports pty's.  'a' means it is /dev/ptya0  */
-#define FIRST_PTY_LETTER 'p'
-
-/* Run only once.  We need a `for'-loop because the code uses `continue'.  */
-#define PTY_ITERATION  int i; for (i = 0; i < 1; i++)
 #define PTY_NAME_SPRINTF       /* none */
 #define PTY_TTY_NAME_SPRINTF   /* none */
 /* Note that openpty may fork via grantpt on Mac OS X 10.4/Darwin 8.

=== modified file 'src/s/gnu-linux.h'
--- a/src/s/gnu-linux.h 2012-07-12 00:49:24 +0000
+++ b/src/s/gnu-linux.h 2012-07-12 06:34:40 +0000
@@ -28,9 +28,6 @@
 #if defined HAVE_GRANTPT
 #define UNIX98_PTYS
 
-/* Run only once.  We need a `for'-loop because the code uses `continue'.  */
-#define PTY_ITERATION  int i; for (i = 0; i < 1; i++)
-
 #ifdef HAVE_GETPT
 #define PTY_NAME_SPRINTF
 #define PTY_OPEN fd = getpt ()
@@ -56,13 +53,7 @@
     sigunblock (sigmask (SIGCHLD));                    \
   }
 
-#else /* not HAVE_GRANTPT */
-
-/* Letter to use in finding device name of first pty,
-   if system supports pty's.  'p' means it is /dev/ptyp0  */
-#define FIRST_PTY_LETTER 'p'
-
-#endif  /* not HAVE_GRANTPT */
+#endif  /* HAVE_GRANTPT */
 
 /* Here, on a separate page, add any special hacks needed
    to make Emacs work on this system.  For example,

=== modified file 'src/s/hpux10-20.h'
--- a/src/s/hpux10-20.h 2012-07-12 01:49:28 +0000
+++ b/src/s/hpux10-20.h 2012-07-12 06:34:40 +0000
@@ -24,10 +24,6 @@
 #define USG5
 #define HPUX
 
-/* Letter to use in finding device name of first pty,
-   if system supports pty's.  'p' means it is /dev/ptym/ptyp0  */
-#define FIRST_PTY_LETTER 'p'
-
 /* Special hacks needed to make Emacs run on this system.  */
 
 /* This is how to get the device name of the tty end of a pty.  */

=== modified file 'src/s/irix6-5.h'
--- a/src/s/irix6-5.h   2012-07-12 01:49:28 +0000
+++ b/src/s/irix6-5.h   2012-07-12 06:34:40 +0000
@@ -26,11 +26,6 @@
 
 #undef SETUP_SLAVE_PTY
 
-/* Letter to use in finding device name of first pty,
-   if system supports pty's.  'a' means it is /dev/ptya0  */
-#undef FIRST_PTY_LETTER
-#define FIRST_PTY_LETTER 'q'
-
 /* No need to use sprintf to get the tty name--we get that from _getpty.  */
 #define PTY_TTY_NAME_SPRINTF
 /* No need to get the pty name at all.  */
@@ -39,8 +34,6 @@
 #ifdef emacs
 char *_getpty();
 #endif
-/* We need only try once to open a pty.  */
-#define PTY_ITERATION
 /* Here is how to do it.  */
 #define PTY_OPEN                                           \
 {                                                          \

=== modified file 'src/s/template.h'
--- a/src/s/template.h  2012-07-12 00:49:24 +0000
+++ b/src/s/template.h  2012-07-12 06:34:40 +0000
@@ -29,10 +29,6 @@
 /* #define BSD4_2 */
 /* #define BSD_SYSTEM */
 
-/* Letter to use in finding device name of first pty,
-   if system supports pty's.  'a' means it is /dev/ptya0.  */
-#define FIRST_PTY_LETTER 'a'
-
 /* subprocesses should be undefined if you do NOT want to
    have code for asynchronous subprocesses
    (as used in M-x compile and M-x shell).

=== modified file 'src/s/usg5-4-common.h'
--- a/src/s/usg5-4-common.h     2012-07-11 23:40:59 +0000
+++ b/src/s/usg5-4-common.h     2012-07-12 06:34:40 +0000
@@ -64,10 +64,6 @@
    this is all we need.  */
 #define TIOCSIGSEND TIOCSIGNAL
 
-/* This change means that we don't loop through allocate_pty too many
-   times in the (rare) event of a failure.  */
-#define FIRST_PTY_LETTER 'z'
-
 /* This sets the name of the master side of the PTY.  */
 #define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptmx");
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]