diff options
| author | Glenn Morris | 2012-07-12 00:43:05 -0700 |
|---|---|---|
| committer | Glenn Morris | 2012-07-12 00:43:05 -0700 |
| commit | 3f922c3769247bef882fb399abcb601a066f4a31 (patch) | |
| tree | 05a41e428449fc846c155959a03788507ec757e6 /src | |
| parent | 0ab7b23ae0a12669fef7f5939fbb0161f29280a2 (diff) | |
| download | emacs-3f922c3769247bef882fb399abcb601a066f4a31.tar.gz emacs-3f922c3769247bef882fb399abcb601a066f4a31.zip | |
Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF from src/s to configure
* configure.ac (PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF): Move here from src/s.
* src/s/aix4-2.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/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/s/aix4-2.h | 5 | ||||
| -rw-r--r-- | src/s/cygwin.h | 3 | ||||
| -rw-r--r-- | src/s/darwin.h | 3 | ||||
| -rw-r--r-- | src/s/gnu-linux.h | 25 | ||||
| -rw-r--r-- | src/s/hpux10-20.h | 8 | ||||
| -rw-r--r-- | src/s/irix6-5.h | 5 | ||||
| -rw-r--r-- | src/s/sol2-6.h | 24 | ||||
| -rw-r--r-- | src/s/unixware.h | 23 | ||||
| -rw-r--r-- | src/s/usg5-4-common.h | 3 |
10 files changed, 5 insertions, 99 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 8ba63959ba4..804da9c2eef 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | 2012-07-12 Glenn Morris <rgm@gnu.org> | 1 | 2012-07-12 Glenn Morris <rgm@gnu.org> |
| 2 | 2 | ||
| 3 | * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h: | ||
| 4 | * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h: | ||
| 5 | * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h: | ||
| 6 | Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure. | ||
| 7 | |||
| 3 | * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h: | 8 | * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h: |
| 4 | Move PTY_OPEN to configure. | 9 | Move PTY_OPEN to configure. |
| 5 | 10 | ||
diff --git a/src/s/aix4-2.h b/src/s/aix4-2.h index 326d7217acb..49eabfc8466 100644 --- a/src/s/aix4-2.h +++ b/src/s/aix4-2.h | |||
| @@ -26,11 +26,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 26 | #define _AIX | 26 | #define _AIX |
| 27 | #endif | 27 | #endif |
| 28 | 28 | ||
| 29 | /* In AIX, you allocate a pty by opening /dev/ptc to get the master side. | ||
| 30 | To get the name of the slave side, you just ttyname() the master side. */ | ||
| 31 | #define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptc"); | ||
| 32 | #define PTY_TTY_NAME_SPRINTF strcpy (pty_name, ttyname (fd)); | ||
| 33 | |||
| 34 | 29 | ||
| 35 | /* Special items needed to make Emacs run on this system. */ | 30 | /* Special items needed to make Emacs run on this system. */ |
| 36 | 31 | ||
diff --git a/src/s/cygwin.h b/src/s/cygwin.h index 79a8999b034..7c32fd3f90d 100644 --- a/src/s/cygwin.h +++ b/src/s/cygwin.h | |||
| @@ -17,8 +17,5 @@ GNU General Public License for more details. | |||
| 17 | You should have received a copy of the GNU General Public License | 17 | You should have received a copy of the GNU General Public License |
| 18 | along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | 18 | along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ |
| 19 | 19 | ||
| 20 | #define PTY_NAME_SPRINTF /* none */ | ||
| 21 | #define PTY_TTY_NAME_SPRINTF /* none */ | ||
| 22 | |||
| 23 | /* Used in various places to enable cygwin-specific code changes. */ | 20 | /* Used in various places to enable cygwin-specific code changes. */ |
| 24 | #define CYGWIN 1 | 21 | #define CYGWIN 1 |
diff --git a/src/s/darwin.h b/src/s/darwin.h index 569b24e3a6e..c853f9d94f0 100644 --- a/src/s/darwin.h +++ b/src/s/darwin.h | |||
| @@ -30,9 +30,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 30 | distinguish OS X from pure Darwin. */ | 30 | distinguish OS X from pure Darwin. */ |
| 31 | #define DARWIN_OS | 31 | #define DARWIN_OS |
| 32 | 32 | ||
| 33 | #define PTY_NAME_SPRINTF /* none */ | ||
| 34 | #define PTY_TTY_NAME_SPRINTF /* none */ | ||
| 35 | |||
| 36 | /* PTYs only work correctly on Darwin 7 or higher. So make the default | 33 | /* PTYs only work correctly on Darwin 7 or higher. So make the default |
| 37 | for process-connection-type dependent on the kernel version. */ | 34 | for process-connection-type dependent on the kernel version. */ |
| 38 | #define MIN_PTY_KERNEL_VERSION '7' | 35 | #define MIN_PTY_KERNEL_VERSION '7' |
diff --git a/src/s/gnu-linux.h b/src/s/gnu-linux.h index 20a2354a2ab..626113b119c 100644 --- a/src/s/gnu-linux.h +++ b/src/s/gnu-linux.h | |||
| @@ -27,31 +27,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 27 | 27 | ||
| 28 | #if defined HAVE_GRANTPT | 28 | #if defined HAVE_GRANTPT |
| 29 | #define UNIX98_PTYS | 29 | #define UNIX98_PTYS |
| 30 | |||
| 31 | #ifdef HAVE_GETPT | ||
| 32 | #define PTY_NAME_SPRINTF | ||
| 33 | #else /* not HAVE_GETPT */ | ||
| 34 | #define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptmx"); | ||
| 35 | #endif /* not HAVE_GETPT */ | ||
| 36 | |||
| 37 | /* Note that grantpt and unlockpt may fork. We must block SIGCHLD to | ||
| 38 | prevent sigchld_handler from intercepting the child's death. */ | ||
| 39 | #define PTY_TTY_NAME_SPRINTF \ | ||
| 40 | { \ | ||
| 41 | char *ptyname; \ | ||
| 42 | \ | ||
| 43 | sigblock (sigmask (SIGCHLD)); \ | ||
| 44 | if (grantpt (fd) == -1 || unlockpt (fd) == -1 \ | ||
| 45 | || !(ptyname = ptsname(fd))) \ | ||
| 46 | { \ | ||
| 47 | sigunblock (sigmask (SIGCHLD)); \ | ||
| 48 | close (fd); \ | ||
| 49 | return -1; \ | ||
| 50 | } \ | ||
| 51 | snprintf (pty_name, sizeof pty_name, "%s", ptyname); \ | ||
| 52 | sigunblock (sigmask (SIGCHLD)); \ | ||
| 53 | } | ||
| 54 | |||
| 55 | #endif /* HAVE_GRANTPT */ | 30 | #endif /* HAVE_GRANTPT */ |
| 56 | 31 | ||
| 57 | /* Here, on a separate page, add any special hacks needed | 32 | /* Here, on a separate page, add any special hacks needed |
diff --git a/src/s/hpux10-20.h b/src/s/hpux10-20.h index bb81eb800e4..b9a1d8edab8 100644 --- a/src/s/hpux10-20.h +++ b/src/s/hpux10-20.h | |||
| @@ -26,14 +26,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 26 | 26 | ||
| 27 | /* Special hacks needed to make Emacs run on this system. */ | 27 | /* Special hacks needed to make Emacs run on this system. */ |
| 28 | 28 | ||
| 29 | /* This is how to get the device name of the tty end of a pty. */ | ||
| 30 | #define PTY_TTY_NAME_SPRINTF \ | ||
| 31 | sprintf (pty_name, "/dev/pty/tty%c%x", c, i); | ||
| 32 | |||
| 33 | /* This is how to get the device name of the control end of a pty. */ | ||
| 34 | #define PTY_NAME_SPRINTF \ | ||
| 35 | sprintf (pty_name, "/dev/ptym/pty%c%x", c, i); | ||
| 36 | |||
| 37 | /* Assar Westerlund <assar@sics.se> says this is necessary for | 29 | /* Assar Westerlund <assar@sics.se> says this is necessary for |
| 38 | HP-UX 10.20, and that it works for HP-UX 0 as well. */ | 30 | HP-UX 10.20, and that it works for HP-UX 0 as well. */ |
| 39 | #define NO_EDITRES | 31 | #define NO_EDITRES |
diff --git a/src/s/irix6-5.h b/src/s/irix6-5.h index b053634d17c..39ac59a00c2 100644 --- a/src/s/irix6-5.h +++ b/src/s/irix6-5.h | |||
| @@ -26,11 +26,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 26 | 26 | ||
| 27 | #undef SETUP_SLAVE_PTY | 27 | #undef SETUP_SLAVE_PTY |
| 28 | 28 | ||
| 29 | /* No need to use sprintf to get the tty name--we get that from _getpty. */ | ||
| 30 | #define PTY_TTY_NAME_SPRINTF | ||
| 31 | /* No need to get the pty name at all. */ | ||
| 32 | #undef PTY_NAME_SPRINTF | ||
| 33 | #define PTY_NAME_SPRINTF | ||
| 34 | #ifdef emacs | 29 | #ifdef emacs |
| 35 | char *_getpty(); | 30 | char *_getpty(); |
| 36 | #endif | 31 | #endif |
diff --git a/src/s/sol2-6.h b/src/s/sol2-6.h index e77d9e5a901..ff6cfc277cc 100644 --- a/src/s/sol2-6.h +++ b/src/s/sol2-6.h | |||
| @@ -21,28 +21,4 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 21 | 21 | ||
| 22 | #define SOLARIS2 | 22 | #define SOLARIS2 |
| 23 | 23 | ||
| 24 | /* This is the same definition as in usg5-4-common.h, but with sigblock/sigunblock | ||
| 25 | rather than sighold/sigrelse, which appear to be BSD4.1 specific. | ||
| 26 | It may also be appropriate for SVR4.x | ||
| 27 | (x<2) but I'm not sure. fnf@cygnus.com */ | ||
| 28 | /* This sets the name of the slave side of the PTY. On SysVr4, | ||
| 29 | grantpt(3) forks a subprocess, so keep sigchld_handler() from | ||
| 30 | intercepting that death. If any child but grantpt's should die | ||
| 31 | within, it should be caught after sigrelse(2). */ | ||
| 32 | |||
| 33 | #define PTY_TTY_NAME_SPRINTF \ | ||
| 34 | { \ | ||
| 35 | char *ptsname (int), *ptyname; \ | ||
| 36 | \ | ||
| 37 | sigblock (sigmask (SIGCLD)); \ | ||
| 38 | if (grantpt (fd) == -1) \ | ||
| 39 | { emacs_close (fd); return -1; } \ | ||
| 40 | sigunblock (sigmask (SIGCLD)); \ | ||
| 41 | if (unlockpt (fd) == -1) \ | ||
| 42 | { emacs_close (fd); return -1; } \ | ||
| 43 | if (!(ptyname = ptsname (fd))) \ | ||
| 44 | { emacs_close (fd); return -1; } \ | ||
| 45 | snprintf (pty_name, sizeof pty_name, "%s", ptyname); \ | ||
| 46 | } | ||
| 47 | |||
| 48 | #define GC_SETJMP_WORKS 1 | 24 | #define GC_SETJMP_WORKS 1 |
diff --git a/src/s/unixware.h b/src/s/unixware.h index 5bda987ffe1..f42e6363245 100644 --- a/src/s/unixware.h +++ b/src/s/unixware.h | |||
| @@ -20,29 +20,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 20 | 20 | ||
| 21 | #include "usg5-4-common.h" | 21 | #include "usg5-4-common.h" |
| 22 | 22 | ||
| 23 | /* This is the same definition as in usg5-4-common.h, but with sigblock/sigunblock | ||
| 24 | rather than sighold/sigrelse, which appear to be BSD4.1 specific. | ||
| 25 | It may also be appropriate for SVR4.x | ||
| 26 | (x<2) but I'm not sure. fnf@cygnus.com */ | ||
| 27 | /* This sets the name of the slave side of the PTY. On SysVr4, | ||
| 28 | grantpt(3) forks a subprocess, so keep sigchld_handler() from | ||
| 29 | intercepting that death. If any child but grantpt's should die | ||
| 30 | within, it should be caught after sigrelse(2). */ | ||
| 31 | #define PTY_TTY_NAME_SPRINTF \ | ||
| 32 | { \ | ||
| 33 | char *ptsname (int), *ptyname; \ | ||
| 34 | \ | ||
| 35 | sigblock(sigmask(SIGCLD)); \ | ||
| 36 | if (grantpt(fd) == -1) \ | ||
| 37 | fatal("could not grant slave pty"); \ | ||
| 38 | sigunblock(sigmask(SIGCLD)); \ | ||
| 39 | if (unlockpt(fd) == -1) \ | ||
| 40 | fatal("could not unlock slave pty"); \ | ||
| 41 | if (!(ptyname = ptsname(fd))) \ | ||
| 42 | fatal ("could not enable slave pty"); \ | ||
| 43 | snprintf (pty_name, sizeof pty_name, "%s", ptyname); \ | ||
| 44 | } | ||
| 45 | |||
| 46 | /* Conservative garbage collection has not been tested, so for now | 23 | /* Conservative garbage collection has not been tested, so for now |
| 47 | play it safe and stick with the old-fashioned way of marking. */ | 24 | play it safe and stick with the old-fashioned way of marking. */ |
| 48 | #define GC_MARK_STACK GC_USE_GCPROS_AS_BEFORE | 25 | #define GC_MARK_STACK GC_USE_GCPROS_AS_BEFORE |
diff --git a/src/s/usg5-4-common.h b/src/s/usg5-4-common.h index 94d83dd81ef..3d3cea803dc 100644 --- a/src/s/usg5-4-common.h +++ b/src/s/usg5-4-common.h | |||
| @@ -64,9 +64,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 64 | this is all we need. */ | 64 | this is all we need. */ |
| 65 | #define TIOCSIGSEND TIOCSIGNAL | 65 | #define TIOCSIGSEND TIOCSIGNAL |
| 66 | 66 | ||
| 67 | /* This sets the name of the master side of the PTY. */ | ||
| 68 | #define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptmx"); | ||
| 69 | |||
| 70 | /* Push various streams modules onto a PTY channel. */ | 67 | /* Push various streams modules onto a PTY channel. */ |
| 71 | #define SETUP_SLAVE_PTY \ | 68 | #define SETUP_SLAVE_PTY \ |
| 72 | if (ioctl (xforkin, I_PUSH, "ptem") == -1) \ | 69 | if (ioctl (xforkin, I_PUSH, "ptem") == -1) \ |