mirror of https://github.com/MidnightCommander/mc
* subshell.c (pty_open_master) [!HAVE_SCO && HAVE_GRANTPT]:
Don't try to close a file that wasn't opened.
This commit is contained in:
parent
35e16ef9b0
commit
826a5594ac
|
@ -1,5 +1,8 @@
|
|||
2001-05-29 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* subshell.c (pty_open_master) [!HAVE_SCO && HAVE_GRANTPT]:
|
||||
Don't try to close a file that wasn't opened.
|
||||
|
||||
* xslint.c: Remove slang_init() and FIXME in the comment.
|
||||
* main.c (main) [!HAVE_SLANG]: Don't call slang_init().
|
||||
|
||||
|
|
|
@ -1158,8 +1158,10 @@ static int pty_open_master (char *pty_name)
|
|||
strcpy (pty_name, "/dev/ptmx");
|
||||
pty_master = open (pty_name, O_RDWR);
|
||||
#endif
|
||||
if (pty_master == -1
|
||||
|| grantpt (pty_master) == -1 /* Grant access to slave */
|
||||
if (pty_master == -1)
|
||||
return -1;
|
||||
|
||||
if (grantpt (pty_master) == -1 /* Grant access to slave */
|
||||
|| unlockpt (pty_master) == -1 /* Clear slave's lock flag */
|
||||
|| !(slave_name = ptsname (pty_master))) /* Get slave's name */
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue