From 33d63ff4db56fb6e2fad2ac145031fb7328d16f2 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 13 Jul 2012 17:45:55 -0400 Subject: [PATCH] Move SETUP_SLAVE_PTY from src/s to configure * 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 | 18 ++++++++++++------ src/ChangeLog | 5 +++++ src/s/irix6-5.h | 2 -- src/s/usg5-4-common.h | 8 -------- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/configure.ac b/configure.ac index b59da4ff02e..b6a8b99e52b 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/src/ChangeLog b/src/ChangeLog index 4a7c481b8b1..9f26c236fed 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-07-13 Glenn Morris + + * 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 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP. diff --git a/src/s/irix6-5.h b/src/s/irix6-5.h index a7365a76a91..1d1989ad9ac 100644 --- a/src/s/irix6-5.h +++ b/src/s/irix6-5.h @@ -22,8 +22,6 @@ along with GNU Emacs. If not, see . */ #undef _longjmp /* use system versions, not conservative aliases */ #undef _setjmp -#undef SETUP_SLAVE_PTY - #ifdef emacs char *_getpty(); #endif diff --git a/src/s/usg5-4-common.h b/src/s/usg5-4-common.h index 93a05ebec54..6ead01d3712 100644 --- a/src/s/usg5-4-common.h +++ b/src/s/usg5-4-common.h @@ -52,11 +52,3 @@ along with GNU Emacs. If not, see . */ 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"); -- 2.39.2