(PTY_TTY_NAME_SPRINTF): Make failure non-fatal.
This commit is contained in:
parent
4824033924
commit
7ac098ffa9
1 changed files with 11 additions and 11 deletions
|
@ -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; \
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue