|
@ -1,4 +1,4 @@ |
|
|
/* $OpenBSD: pty.c,v 1.8 2002/05/24 22:04:02 deraadt Exp $ */ |
|
|
|
|
|
|
|
|
/* $OpenBSD: pty.c,v 1.9 2002/06/09 22:18:43 fgsch Exp $ */ |
|
|
/*- |
|
|
/*- |
|
|
* Copyright (c) 1990, 1993 |
|
|
* Copyright (c) 1990, 1993 |
|
|
* The Regents of the University of California. All rights reserved. |
|
|
* The Regents of the University of California. All rights reserved. |
|
@ -34,7 +34,7 @@ |
|
|
|
|
|
|
|
|
#if defined(LIBC_SCCS) && !defined(lint) |
|
|
#if defined(LIBC_SCCS) && !defined(lint) |
|
|
/* from: static char sccsid[] = "@(#)pty.c 8.1 (Berkeley) 6/4/93"; */ |
|
|
/* from: static char sccsid[] = "@(#)pty.c 8.1 (Berkeley) 6/4/93"; */ |
|
|
static char *rcsid = "$Id: pty.c,v 1.8 2002/05/24 22:04:02 deraadt Exp $"; |
|
|
|
|
|
|
|
|
static const char rcsid[] = "$Id: pty.c,v 1.9 2002/06/09 22:18:43 fgsch Exp $"; |
|
|
#endif /* LIBC_SCCS and not lint */ |
|
|
#endif /* LIBC_SCCS and not lint */ |
|
|
|
|
|
|
|
|
#include <sys/cdefs.h> |
|
|
#include <sys/cdefs.h> |
|
@ -94,10 +94,10 @@ openpty(amaster, aslave, name, termp, winp) |
|
|
strlcpy(name, line, 16); |
|
|
strlcpy(name, line, 16); |
|
|
} |
|
|
} |
|
|
if (termp) |
|
|
if (termp) |
|
|
(void) tcsetattr(slave, |
|
|
|
|
|
|
|
|
(void) tcsetattr(slave, |
|
|
TCSAFLUSH, termp); |
|
|
TCSAFLUSH, termp); |
|
|
if (winp) |
|
|
if (winp) |
|
|
(void) ioctl(slave, TIOCSWINSZ, |
|
|
|
|
|
|
|
|
(void) ioctl(slave, TIOCSWINSZ, |
|
|
(char *)winp); |
|
|
(char *)winp); |
|
|
return (0); |
|
|
return (0); |
|
|
} |
|
|
} |
|
@ -125,7 +125,7 @@ forkpty(amaster, name, termp, winp) |
|
|
case -1: |
|
|
case -1: |
|
|
return (-1); |
|
|
return (-1); |
|
|
case 0: |
|
|
case 0: |
|
|
/* |
|
|
|
|
|
|
|
|
/* |
|
|
* child |
|
|
* child |
|
|
*/ |
|
|
*/ |
|
|
(void) close(master); |
|
|
(void) close(master); |
|
|