aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1994-07-19 16:11:28 +0000
committerRichard M. Stallman1994-07-19 16:11:28 +0000
commit5bf62b08d9b79fb909934d7e0640a5b517940735 (patch)
tree9f04355484e9066aed196f7f5dddf7bdee9892ac /src
parentf486195cb1d38aeef29c4d63f0f2aa8cf6730cd5 (diff)
downloademacs-5bf62b08d9b79fb909934d7e0640a5b517940735.tar.gz
emacs-5bf62b08d9b79fb909934d7e0640a5b517940735.zip
(PTY_TTY_NAME_SPRINTF): Fail smoothly if cannot get pty.
Diffstat (limited to 'src')
-rw-r--r--src/s/usg5-4.h36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/s/usg5-4.h b/src/s/usg5-4.h
index d60a5eb8524..f8e6ae9a695 100644
--- a/src/s/usg5-4.h
+++ b/src/s/usg5-4.h
@@ -131,7 +131,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
131#define HAVE_WAIT_HEADER 131#define HAVE_WAIT_HEADER
132#define WAITTYPE int 132#define WAITTYPE int
133#define wait3(status, options, rusage) \ 133#define wait3(status, options, rusage) \
134 waitpid((pid_t) -1, (status), (options)) 134 waitpid ((pid_t) -1, (status), (options))
135#define WRETCODE(w) (w >> 8) 135#define WRETCODE(w) (w >> 8)
136 136
137/* TIOCGPGRP is broken in SysVr4, so we can't send signals to PTY 137/* TIOCGPGRP is broken in SysVr4, so we can't send signals to PTY
@@ -155,20 +155,20 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
155 intercepting that death. If any child but grantpt's should die 155 intercepting that death. If any child but grantpt's should die
156 within, it should be caught after sigrelse(2). */ 156 within, it should be caught after sigrelse(2). */
157 157
158#define PTY_TTY_NAME_SPRINTF \ 158#define PTY_TTY_NAME_SPRINTF \
159 { \ 159 { \
160 char *ptsname(), *ptyname; \ 160 char *ptsname (), *ptyname; \
161 \ 161 \
162 sighold(SIGCLD); \ 162 sighold (SIGCLD); \
163 if (grantpt(fd) == -1) \ 163 if (grantpt (fd) == -1) \
164 fatal("could not grant slave pty"); \ 164 { close (fd); return -1; } \
165 sigrelse(SIGCLD); \ 165 sigrelse (SIGCLD); \
166 if (unlockpt(fd) == -1) \ 166 if (unlockpt (fd) == -1) \
167 fatal("could not unlock slave pty"); \ 167 { close (fd); return -1; } \
168 if (!(ptyname = ptsname(fd))) \ 168 if (!(ptyname = ptsname (fd))) \
169 fatal ("could not enable slave pty"); \ 169 { close (fd); return -1; } \
170 strncpy(pty_name, ptyname, sizeof(pty_name)); \ 170 strncpy (pty_name, ptyname, sizeof (pty_name)); \
171 pty_name[sizeof(pty_name) - 1] = 0; \ 171 pty_name[sizeof (pty_name) - 1] = 0; \
172 } 172 }
173 173
174/* Push various streams modules onto a PTY channel. */ 174/* Push various streams modules onto a PTY channel. */
@@ -199,6 +199,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
199 So give it a try. */ 199 So give it a try. */
200#define HAVE_SOCKETS 200#define HAVE_SOCKETS
201 201
202#define bcopy(src,dst,n) memmove(dst,src,n) 202#define bcopy(src,dst,n) memmove (dst,src,n)
203#define bcmp(src,dst,n) memcmp(src,dst,n) 203#define bcmp(src,dst,n) memcmp (src,dst,n)
204#define bzero(s,n) memset(s,0,n) 204#define bzero(s,n) memset (s,0,n)