]> code.delx.au - gnu-emacs/commitdiff
Move SETUP_SLAVE_PTY from src/s to configure
authorGlenn Morris <rgm@gnu.org>
Fri, 13 Jul 2012 21:45:55 +0000 (17:45 -0400)
committerGlenn Morris <rgm@gnu.org>
Fri, 13 Jul 2012 21:45:55 +0000 (17:45 -0400)
* configure.ac (SETUP_SLAVE_PTY): Move here from src/s.
(FIRST_PTY_LETTER, PTY_NAME_SPRINTF): Combine sol2/unixware cases.

* src/s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
* src/s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.

configure.ac
src/ChangeLog
src/s/irix6-5.h
src/s/usg5-4-common.h

index b59da4ff02e27f7ddfaeadb5e45726565e71a91e..b6a8b99e52b68ad5b84ded52b19319351b384e79 100644 (file)
@@ -3412,10 +3412,6 @@ case $opsys in
     ;;
 
   sol2* )
-    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'])
-    AC_DEFINE(PTY_NAME_SPRINTF, [strcpy (pty_name, "/dev/ptmx");] )
     dnl Uses sigblock/sigunblock rather than sighold/sigrelse,
     dnl which appear to be BSD4.1 specific.  It may also be appropriate
     dnl for SVR4.x (x<2) but I'm not sure.   fnf@cygnus.com
@@ -3425,11 +3421,21 @@ case $opsys in
     AC_DEFINE(PTY_TTY_NAME_SPRINTF, [{ char *ptsname (int), *ptyname; sigblock (sigmask (SIGCLD)); if (grantpt (fd) == -1) { emacs_close (fd); return -1; } sigunblock (sigmask (SIGCLD)); if (unlockpt (fd) == -1) { emacs_close (fd); return -1; } if (!(ptyname = ptsname (fd))) { emacs_close (fd); return -1; } snprintf (pty_name, sizeof pty_name, "%s", ptyname); }] )
     ;;
 
-  dnl Comments are as per sol2*.
   unixware )
+    dnl Comments are as per sol2*.
+    AC_DEFINE(PTY_TTY_NAME_SPRINTF, [{ char *ptsname (int), *ptyname; sigblock(sigmask(SIGCLD)); if (grantpt(fd) == -1) fatal("could not grant slave pty"); sigunblock(sigmask(SIGCLD)); if (unlockpt(fd) == -1) fatal("could not unlock slave pty"); if (!(ptyname = ptsname(fd))) fatal ("could not enable slave pty"); snprintf (pty_name, sizeof pty_name, "%s", ptyname); }] )
+    ;;
+esac
+
+
+case $opsys in
+  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'])
     AC_DEFINE(PTY_NAME_SPRINTF, [strcpy (pty_name, "/dev/ptmx");] )
-    AC_DEFINE(PTY_TTY_NAME_SPRINTF, [{ char *ptsname (int), *ptyname; sigblock(sigmask(SIGCLD)); if (grantpt(fd) == -1) fatal("could not grant slave pty"); sigunblock(sigmask(SIGCLD)); if (unlockpt(fd) == -1) fatal("could not unlock slave pty"); if (!(ptyname = ptsname(fd))) fatal ("could not enable slave pty"); snprintf (pty_name, sizeof pty_name, "%s", ptyname); }] )
+    dnl Push various streams modules onto a PTY channel.  Used in process.c.
+    AC_DEFINE(SETUP_SLAVE_PTY, [if (ioctl (xforkin, I_PUSH, "ptem") == -1) fatal ("ioctl I_PUSH ptem"); if (ioctl (xforkin, I_PUSH, "ldterm") == -1) fatal ("ioctl I_PUSH ldterm"); if (ioctl (xforkin, I_PUSH, "ttcompat") == -1) fatal ("ioctl I_PUSH ttcompat");], [How to set up a slave PTY, if needed.])
     ;;
 esac
 
index 4a7c481b8b1ad6b2df70ada15fcd9511ddee103d..9f26c236fed3bc54cb8229d2b1fb1423df90b898 100644 (file)
@@ -1,3 +1,8 @@
+2012-07-13  Glenn Morris  <rgm@gnu.org>
+
+       * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
+       * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
+
 2012-07-13  Jan Djärv  <jan.h.d@swipnet.se>
 
        * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
index a7365a76a91ac19aaeab5509e48e6f0703e15a3f..1d1989ad9ac2cbbbcd595ec3c4517a71d0d59009 100644 (file)
@@ -22,8 +22,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #undef _longjmp /* use system versions, not conservative aliases */
 #undef _setjmp
 
-#undef SETUP_SLAVE_PTY
-
 #ifdef emacs
 char *_getpty();
 #endif
index 93a05ebec545c47cc0679dbdf2782bb8114c0418..6ead01d3712a6d01146eea03cd553e51c481cac4 100644 (file)
@@ -52,11 +52,3 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
    this is all we need.  */
 #define TIOCSIGSEND TIOCSIGNAL
 
-/* Push various streams modules onto a PTY channel.  */
-#define SETUP_SLAVE_PTY \
-  if (ioctl (xforkin, I_PUSH, "ptem") == -1)   \
-    fatal ("ioctl I_PUSH ptem");               \
-  if (ioctl (xforkin, I_PUSH, "ldterm") == -1) \
-    fatal ("ioctl I_PUSH ldterm");     \
-  if (ioctl (xforkin, I_PUSH, "ttcompat") == -1) \
-    fatal ("ioctl I_PUSH ttcompat");