diff options
| author | Glenn Morris | 2012-07-12 00:10:44 -0700 |
|---|---|---|
| committer | Glenn Morris | 2012-07-12 00:10:44 -0700 |
| commit | 0ab7b23ae0a12669fef7f5939fbb0161f29280a2 (patch) | |
| tree | 97d7afd17794a592740e074614d63761dba418f6 /src | |
| parent | 6e7778482fb5fc9e527b799db7c83b210674c2a8 (diff) | |
| download | emacs-0ab7b23ae0a12669fef7f5939fbb0161f29280a2.tar.gz emacs-0ab7b23ae0a12669fef7f5939fbb0161f29280a2.zip | |
Move PTY_OPEN from src/s to configure
* configure.ac (PTY_OPEN) Move here from src/s.
* src/s/cygwin.h, src/s/darwin.h, src/s/gnu-linux.h, src/s/irix6-5.h:
Move PTY_OPEN to configure.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 3 | ||||
| -rw-r--r-- | src/s/cygwin.h | 13 | ||||
| -rw-r--r-- | src/s/darwin.h | 13 | ||||
| -rw-r--r-- | src/s/gnu-linux.h | 1 | ||||
| -rw-r--r-- | src/s/irix6-5.h | 20 |
5 files changed, 3 insertions, 47 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 19b89259067..8ba63959ba4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2012-07-12 Glenn Morris <rgm@gnu.org> | 1 | 2012-07-12 Glenn Morris <rgm@gnu.org> |
| 2 | 2 | ||
| 3 | * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h: | ||
| 4 | Move PTY_OPEN to configure. | ||
| 5 | |||
| 3 | * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h: | 6 | * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h: |
| 4 | * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h: | 7 | * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h: |
| 5 | * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure. | 8 | * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure. |
diff --git a/src/s/cygwin.h b/src/s/cygwin.h index 89db0a047bc..79a8999b034 100644 --- a/src/s/cygwin.h +++ b/src/s/cygwin.h | |||
| @@ -19,19 +19,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 19 | 19 | ||
| 20 | #define PTY_NAME_SPRINTF /* none */ | 20 | #define PTY_NAME_SPRINTF /* none */ |
| 21 | #define PTY_TTY_NAME_SPRINTF /* none */ | 21 | #define PTY_TTY_NAME_SPRINTF /* none */ |
| 22 | #define PTY_OPEN \ | ||
| 23 | do \ | ||
| 24 | { \ | ||
| 25 | int dummy; \ | ||
| 26 | SIGMASKTYPE mask; \ | ||
| 27 | mask = sigblock (sigmask (SIGCHLD)); \ | ||
| 28 | if (-1 == openpty (&fd, &dummy, pty_name, 0, 0)) \ | ||
| 29 | fd = -1; \ | ||
| 30 | sigsetmask (mask); \ | ||
| 31 | if (fd >= 0) \ | ||
| 32 | emacs_close (dummy); \ | ||
| 33 | } \ | ||
| 34 | while (0) | ||
| 35 | 22 | ||
| 36 | /* Used in various places to enable cygwin-specific code changes. */ | 23 | /* Used in various places to enable cygwin-specific code changes. */ |
| 37 | #define CYGWIN 1 | 24 | #define CYGWIN 1 |
diff --git a/src/s/darwin.h b/src/s/darwin.h index 68667ed7c90..569b24e3a6e 100644 --- a/src/s/darwin.h +++ b/src/s/darwin.h | |||
| @@ -32,19 +32,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 32 | 32 | ||
| 33 | #define PTY_NAME_SPRINTF /* none */ | 33 | #define PTY_NAME_SPRINTF /* none */ |
| 34 | #define PTY_TTY_NAME_SPRINTF /* none */ | 34 | #define PTY_TTY_NAME_SPRINTF /* none */ |
| 35 | /* Note that openpty may fork via grantpt on Mac OS X 10.4/Darwin 8. | ||
| 36 | But we don't have to block SIGCHLD because it is blocked in the | ||
| 37 | implementation of grantpt. */ | ||
| 38 | #define PTY_OPEN \ | ||
| 39 | do \ | ||
| 40 | { \ | ||
| 41 | int slave; \ | ||
| 42 | if (openpty (&fd, &slave, pty_name, NULL, NULL) == -1) \ | ||
| 43 | fd = -1; \ | ||
| 44 | else \ | ||
| 45 | emacs_close (slave); \ | ||
| 46 | } \ | ||
| 47 | while (0) | ||
| 48 | 35 | ||
| 49 | /* PTYs only work correctly on Darwin 7 or higher. So make the default | 36 | /* PTYs only work correctly on Darwin 7 or higher. So make the default |
| 50 | for process-connection-type dependent on the kernel version. */ | 37 | for process-connection-type dependent on the kernel version. */ |
diff --git a/src/s/gnu-linux.h b/src/s/gnu-linux.h index dd4de41f84b..20a2354a2ab 100644 --- a/src/s/gnu-linux.h +++ b/src/s/gnu-linux.h | |||
| @@ -30,7 +30,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 30 | 30 | ||
| 31 | #ifdef HAVE_GETPT | 31 | #ifdef HAVE_GETPT |
| 32 | #define PTY_NAME_SPRINTF | 32 | #define PTY_NAME_SPRINTF |
| 33 | #define PTY_OPEN fd = getpt () | ||
| 34 | #else /* not HAVE_GETPT */ | 33 | #else /* not HAVE_GETPT */ |
| 35 | #define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptmx"); | 34 | #define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptmx"); |
| 36 | #endif /* not HAVE_GETPT */ | 35 | #endif /* not HAVE_GETPT */ |
diff --git a/src/s/irix6-5.h b/src/s/irix6-5.h index cd7b2902026..b053634d17c 100644 --- a/src/s/irix6-5.h +++ b/src/s/irix6-5.h | |||
| @@ -34,26 +34,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 34 | #ifdef emacs | 34 | #ifdef emacs |
| 35 | char *_getpty(); | 35 | char *_getpty(); |
| 36 | #endif | 36 | #endif |
| 37 | /* Here is how to do it. */ | ||
| 38 | #define PTY_OPEN \ | ||
| 39 | { \ | ||
| 40 | struct sigaction ocstat, cstat; \ | ||
| 41 | struct stat stb; \ | ||
| 42 | char * name; \ | ||
| 43 | sigemptyset(&cstat.sa_mask); \ | ||
| 44 | cstat.sa_handler = SIG_DFL; \ | ||
| 45 | cstat.sa_flags = 0; \ | ||
| 46 | sigaction(SIGCLD, &cstat, &ocstat); \ | ||
| 47 | name = _getpty (&fd, O_RDWR | O_NDELAY, 0600, 0); \ | ||
| 48 | sigaction(SIGCLD, &ocstat, (struct sigaction *)0); \ | ||
| 49 | if (name == 0) \ | ||
| 50 | return -1; \ | ||
| 51 | if (fd < 0) \ | ||
| 52 | return -1; \ | ||
| 53 | if (fstat (fd, &stb) < 0) \ | ||
| 54 | return -1; \ | ||
| 55 | strcpy (pty_name, name); \ | ||
| 56 | } | ||
| 57 | 37 | ||
| 58 | /* Ulimit(UL_GMEMLIM) is busted... */ | 38 | /* Ulimit(UL_GMEMLIM) is busted... */ |
| 59 | #define ULIMIT_BREAK_VALUE 0x14000000 | 39 | #define ULIMIT_BREAK_VALUE 0x14000000 |