Mercurial > emacs
changeset 14055:df451c7f6820
(PTY_TTY_NAME_SPRINTF): Make failure non-fatal.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Mon, 08 Jan 1996 22:34:43 +0000 |
parents | 103a1b22fcd8 |
children | 41802d268ffb |
files | src/s/sol2-3.h |
diffstat | 1 files changed, 11 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/src/s/sol2-3.h Mon Jan 08 22:29:48 1996 +0000 +++ b/src/s/sol2-3.h Mon Jan 08 22:34:43 1996 +0000 @@ -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; \ }