ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libptytty/src/ptytty.C
(Generate patch)

Comparing libptytty/src/ptytty.C (file contents):
Revision 1.39 by sf-exg, Thu Jun 9 14:14:48 2011 UTC vs.
Revision 1.41 by sf-exg, Fri Nov 11 15:11:18 2011 UTC

39#include <fcntl.h> 39#include <fcntl.h>
40 40
41#ifdef HAVE_SYS_IOCTL_H 41#ifdef HAVE_SYS_IOCTL_H
42# include <sys/ioctl.h> 42# include <sys/ioctl.h>
43#endif 43#endif
44#if defined(HAVE_DEV_PTMX) && defined(HAVE_SYS_STROPTS_H) 44#if defined(HAVE_SYS_STROPTS_H)
45# include <sys/stropts.h> /* for I_PUSH */ 45# include <sys/stropts.h> /* for I_PUSH */
46#endif 46#endif
47#if defined(HAVE_ISASTREAM) && defined(HAVE_STROPTS_H) 47#if defined(HAVE_ISASTREAM) && defined(HAVE_STROPTS_H)
48# include <stropts.h> 48# include <stropts.h>
49#endif 49#endif
78 int pfd; 78 int pfd;
79 79
80# if defined(HAVE_GETPT) 80# if defined(HAVE_GETPT)
81 pfd = getpt(); 81 pfd = getpt();
82# elif defined(HAVE_POSIX_OPENPT) 82# elif defined(HAVE_POSIX_OPENPT)
83 pfd = posix_openpt (O_RDWR); 83 pfd = posix_openpt (O_RDWR | O_NOCTTY);
84# else 84# else
85# ifdef _AIX
85 pfd = open (CLONE_DEVICE, O_RDWR | O_NOCTTY, 0); 86 pfd = open ("/dev/ptc", O_RDWR | O_NOCTTY, 0);
87# else
88 pfd = open ("/dev/ptmx", O_RDWR | O_NOCTTY, 0);
89# endif
86# endif 90# endif
87 91
88 if (pfd >= 0) 92 if (pfd >= 0)
89 { 93 {
90 if (grantpt (pfd) == 0 /* change slave permissions */ 94 if (grantpt (pfd) == 0 /* change slave permissions */
345 put (); 349 put ();
346 return false; 350 return false;
347 } 351 }
348 } 352 }
349 353
350#if defined(HAVE_DEV_PTMX) && defined(I_PUSH) 354#if defined(I_PUSH)
351 /* 355 /*
352 * Push STREAMS modules: 356 * Push STREAMS modules:
353 * ptem: pseudo-terminal hardware emulation module. 357 * ptem: pseudo-terminal hardware emulation module.
354 * ldterm: standard terminal line discipline. 358 * ldterm: standard terminal line discipline.
355 * ttcompat: V7, 4BSD and XENIX STREAMS compatibility module. 359 * ttcompat: V7, 4BSD and XENIX STREAMS compatibility module.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines