Mercurial > emacs
comparison src/s/sol2-3.h @ 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 | a3b8903f3de0 |
children | 63fd40a97a75 |
comparison
equal
deleted
inserted
replaced
14054:103a1b22fcd8 | 14055:df451c7f6820 |
---|---|
33 within, it should be caught after sigrelse(2). */ | 33 within, it should be caught after sigrelse(2). */ |
34 | 34 |
35 #undef PTY_TTY_NAME_SPRINTF | 35 #undef PTY_TTY_NAME_SPRINTF |
36 #define PTY_TTY_NAME_SPRINTF \ | 36 #define PTY_TTY_NAME_SPRINTF \ |
37 { \ | 37 { \ |
38 char *ptsname(), *ptyname; \ | 38 char *ptsname (), *ptyname; \ |
39 \ | 39 \ |
40 sigblock(sigmask(SIGCLD)); \ | 40 sigblock (sigmask (SIGCLD)); \ |
41 if (grantpt(fd) == -1) \ | 41 if (grantpt (fd) == -1) \ |
42 fatal("could not grant slave pty"); \ | 42 { close (fd); return -1; } \ |
43 sigunblock(sigmask(SIGCLD)); \ | 43 sigunblock (sigmask (SIGCLD)); \ |
44 if (unlockpt(fd) == -1) \ | 44 if (unlockpt (fd) == -1) \ |
45 fatal("could not unlock slave pty"); \ | 45 { close (fd); return -1; } \ |
46 if (!(ptyname = ptsname(fd))) \ | 46 if (!(ptyname = ptsname (fd))) \ |
47 fatal ("could not enable slave pty"); \ | 47 { close (fd); return -1; } \ |
48 strncpy(pty_name, ptyname, sizeof(pty_name)); \ | 48 strncpy (pty_name, ptyname, sizeof (pty_name)); \ |
49 pty_name[sizeof(pty_name) - 1] = 0; \ | 49 pty_name[sizeof (pty_name) - 1] = 0; \ |
50 } | 50 } |