=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/Attic/pty.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- src/usr.bin/ssh/Attic/pty.c 1999/11/24 00:26:02 1.7 +++ src/usr.bin/ssh/Attic/pty.c 1999/11/24 19:53:48 1.8 @@ -14,7 +14,7 @@ */ #include "includes.h" -RCSID("$Id: pty.c,v 1.7 1999/11/24 00:26:02 deraadt Exp $"); +RCSID("$Id: pty.c,v 1.8 1999/11/24 19:53:48 markus Exp $"); #include "pty.h" #include "ssh.h" @@ -28,10 +28,12 @@ #define O_NOCTTY 0 #endif -/* Allocates and opens a pty. Returns 0 if no pty could be allocated, - or nonzero if a pty was successfully allocated. On success, open file - descriptors for the pty and tty sides and the name of the tty side are - returned (the buffer must be able to hold at least 64 characters). */ +/* + * Allocates and opens a pty. Returns 0 if no pty could be allocated, or + * nonzero if a pty was successfully allocated. On success, open file + * descriptors for the pty and tty sides and the name of the tty side are + * returned (the buffer must be able to hold at least 64 characters). + */ int pty_allocate(int *ptyfd, int *ttyfd, char *namebuf) @@ -48,8 +50,10 @@ return 1; #else /* HAVE_OPENPTY */ #ifdef HAVE__GETPTY - /* _getpty(3) exists in SGI Irix 4.x, 5.x & 6.x -- it generates - more pty's automagically when needed */ + /* + * _getpty(3) exists in SGI Irix 4.x, 5.x & 6.x -- it generates more + * pty's automagically when needed + */ char *slave; slave = _getpty(ptyfd, O_RDWR, 0622, 0); @@ -68,8 +72,10 @@ return 1; #else /* HAVE__GETPTY */ #ifdef HAVE_DEV_PTMX - /* This code is used e.g. on Solaris 2.x. (Note that Solaris 2.3 - also has bsd-style ptys, but they simply do not work.) */ + /* + * This code is used e.g. on Solaris 2.x. (Note that Solaris 2.3 + * also has bsd-style ptys, but they simply do not work.) + */ int ptm; char *pts; @@ -99,8 +105,7 @@ close(*ptyfd); return 0; } - /* Push the appropriate streams modules, as described in Solaris - pts(7). */ + /* Push the appropriate streams modules, as described in Solaris pts(7). */ if (ioctl(*ttyfd, I_PUSH, "ptem") < 0) error("ioctl I_PUSH ptem: %.100s", strerror(errno)); if (ioctl(*ttyfd, I_PUSH, "ldterm") < 0) @@ -134,8 +139,7 @@ /* BSD-style pty code. */ char buf[64]; int i; - const char *ptymajors = - "pqrstuvwxyzabcdefghijklmnoABCDEFGHIJKLMNOPQRSTUVWXYZ"; + const char *ptymajors = "pqrstuvwxyzabcdefghijklmnoABCDEFGHIJKLMNOPQRSTUVWXYZ"; const char *ptyminors = "0123456789abcdef"; int num_minors = strlen(ptyminors); int num_ptys = strlen(ptymajors) * num_minors; @@ -194,8 +198,10 @@ if (setsid() < 0) error("setsid: %.100s", strerror(errno)); - /* Verify that we are successfully disconnected from the - controlling tty. */ + /* + * Verify that we are successfully disconnected from the controlling + * tty. + */ fd = open("/dev/tty", O_RDWR | O_NOCTTY); if (fd >= 0) { error("Failed to disconnect from controlling tty."); @@ -204,9 +210,11 @@ /* Make it our controlling tty. */ #ifdef TIOCSCTTY debug("Setting controlling tty using TIOCSCTTY."); - /* We ignore errors from this, because HPSUX defines TIOCSCTTY, - but returns EINVAL with these arguments, and there is - absolutely no documentation. */ + /* + * We ignore errors from this, because HPSUX defines TIOCSCTTY, but + * returns EINVAL with these arguments, and there is absolutely no + * documentation. + */ ioctl(*ttyfd, TIOCSCTTY, NULL); #endif /* TIOCSCTTY */ fd = open(ttyname, O_RDWR);