summaryrefslogtreecommitdiff
path: root/src/s
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1996-01-08 22:34:43 +0000
committerKarl Heuer <kwzh@gnu.org>1996-01-08 22:34:43 +0000
commit7ac098ffa96fa2f2828eebe488053eb1183c10be (patch)
treefc17095b01c0c843a4ae241b39b40eae84ac4c94 /src/s
parent48240339243662c5f0f0191c82c0f8de4361f1e1 (diff)
downloademacs-7ac098ffa96fa2f2828eebe488053eb1183c10be.tar.gz
(PTY_TTY_NAME_SPRINTF): Make failure non-fatal.
Diffstat (limited to 'src/s')
-rw-r--r--src/s/sol2-3.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/s/sol2-3.h b/src/s/sol2-3.h
index 2e5d068d193..9d9018aa0be 100644
--- a/src/s/sol2-3.h
+++ b/src/s/sol2-3.h
@@ -35,16 +35,16 @@
#undef PTY_TTY_NAME_SPRINTF
#define PTY_TTY_NAME_SPRINTF \
{ \
- char *ptsname(), *ptyname; \
+ char *ptsname (), *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"); \
- strncpy(pty_name, ptyname, sizeof(pty_name)); \
- pty_name[sizeof(pty_name) - 1] = 0; \
+ sigblock (sigmask (SIGCLD)); \
+ if (grantpt (fd) == -1) \
+ { close (fd); return -1; } \
+ sigunblock (sigmask (SIGCLD)); \
+ if (unlockpt (fd) == -1) \
+ { close (fd); return -1; } \
+ if (!(ptyname = ptsname (fd))) \
+ { close (fd); return -1; } \
+ strncpy (pty_name, ptyname, sizeof (pty_name)); \
+ pty_name[sizeof (pty_name) - 1] = 0; \
}