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.31 by ayin, Thu Nov 15 10:49:05 2007 UTC vs.
Revision 1.33 by ayin, Thu Dec 13 14:42:33 2007 UTC

86 86
87 if (pfd >= 0) 87 if (pfd >= 0)
88 { 88 {
89 if (grantpt (pfd) == 0 /* change slave permissions */ 89 if (grantpt (pfd) == 0 /* change slave permissions */
90 && unlockpt (pfd) == 0) 90 && unlockpt (pfd) == 0)
91 {
91 { /* slave now unlocked */ 92 /* slave now unlocked */
92 *ttydev = strdup (ptsname (pfd)); /* get slave's name */ 93 *ttydev = strdup (ptsname (pfd)); /* get slave's name */
93 return pfd; 94 return pfd;
94 } 95 }
95 96
96 close (pfd); 97 close (pfd);
126 int pfd; 127 int pfd;
127 char *slave; 128 char *slave;
128 129
129 slave = _getpty (&pfd, O_RDWR | O_NONBLOCK | O_NOCTTY, 0622, 0); 130 slave = _getpty (&pfd, O_RDWR | O_NONBLOCK | O_NOCTTY, 0622, 0);
130 131
131 if (slave != NULL) { 132 if (slave != NULL)
133 {
132 *ttydev = strdup (slave); 134 *ttydev = strdup (slave);
133 return pfd; 135 return pfd;
134 } 136 }
135 137
136 return -1; 138 return -1;
137 } 139 }
138 140
139#elif defined(HAVE_DEV_PTC) 141#elif defined(HAVE_DEV_PTC)
325 { 327 {
326#ifdef TTY_GID_SUPPORT 328#ifdef TTY_GID_SUPPORT
327 struct group *gr = getgrnam ("tty"); 329 struct group *gr = getgrnam ("tty");
328 330
329 if (gr) 331 if (gr)
332 {
330 { /* change group ownership of tty to "tty" */ 333 /* change group ownership of tty to "tty" */
331 mode = S_IRUSR | S_IWUSR | S_IWGRP; 334 mode = S_IRUSR | S_IWUSR | S_IWGRP;
332 gid = gr->gr_gid; 335 gid = gr->gr_gid;
333 } 336 }
334 else 337 else
335#endif /* TTY_GID_SUPPORT */ 338#endif /* TTY_GID_SUPPORT */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines