diff options
| author | Richard M. Stallman | 1993-07-23 04:16:38 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-07-23 04:16:38 +0000 |
| commit | 6e27eb5e02b615708dc55514f37a51dfc451bf28 (patch) | |
| tree | 0c27ec854fda97aa343553f6bf86fa40d0006741 /src | |
| parent | 785080c58c4f792c5474a6a6b9226697268525bd (diff) | |
| download | emacs-6e27eb5e02b615708dc55514f37a51dfc451bf28.tar.gz emacs-6e27eb5e02b615708dc55514f37a51dfc451bf28.zip | |
(PTY_OPEN): Use sigaction, not sigsetmask.
Diffstat (limited to 'src')
| -rw-r--r-- | src/s/irix5-0.h | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/src/s/irix5-0.h b/src/s/irix5-0.h index fe42458768a..61928f08dfe 100644 --- a/src/s/irix5-0.h +++ b/src/s/irix5-0.h | |||
| @@ -48,17 +48,26 @@ char *_getpty(); | |||
| 48 | #define PTY_ITERATION | 48 | #define PTY_ITERATION |
| 49 | /* Here is how to do it. */ | 49 | /* Here is how to do it. */ |
| 50 | /* It is necessary to prevent SIGCHLD signals within _getpty. | 50 | /* It is necessary to prevent SIGCHLD signals within _getpty. |
| 51 | So we block them. */ | 51 | So we block them. But since all of Emacs uses classic SYSV signal() |
| 52 | #define PTY_OPEN \ | 52 | signals, there is no reliable way to do this (unlike BSD sighold or |
| 53 | { \ | 53 | POSIX sigaction). On Irix 5.* systems, the implementation of |
| 54 | int mask = sigblock (sigmask (SIGCHLD)); \ | 54 | sigaction is as close as you can get to a universal. */ |
| 55 | char *name = _getpty (&fd, O_RDWR | O_NDELAY, 0600, 0); \ | 55 | #define PTY_OPEN \ |
| 56 | sigsetmask(mask); \ | 56 | { \ |
| 57 | if (name == 0) \ | 57 | struct sigaction ocstat, cstat; \ |
| 58 | return -1; \ | 58 | char * name; \ |
| 59 | if (fd < 0) \ | 59 | sigemptyset(&cstat.sa_mask); \ |
| 60 | return -1; \ | 60 | cstat.sa_handler = SIG_DFL; \ |
| 61 | if (fstat (fd, &stb) < 0) \ | 61 | cstat.sa_flags = 0; \ |
| 62 | return -1; \ | 62 | sigaction(SIGCLD, &cstat, &ocstat); \ |
| 63 | strcpy (pty_name, name); \ | 63 | name = _getpty (&fd, O_RDWR | O_NDELAY, 0600, 0); \ |
| 64 | sigaction(SIGCLD, &ocstat, (struct sigaction *)0); \ | ||
| 65 | if (name == 0) \ | ||
| 66 | return -1; \ | ||
| 67 | if (fd < 0) \ | ||
| 68 | return -1; \ | ||
| 69 | if (fstat (fd, &stb) < 0) \ | ||
| 70 | return -1; \ | ||
| 71 | strcpy (pty_name, name); \ | ||
| 64 | } | 72 | } |
| 73 | |||