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.29 by ayin, Thu Jun 28 17:41:01 2007 UTC vs.
Revision 1.31 by ayin, Thu Nov 15 10:49:05 2007 UTC

122 122
123 static int 123 static int
124 get_pty (int *fd_tty, char **ttydev) 124 get_pty (int *fd_tty, char **ttydev)
125 { 125 {
126 int pfd; 126 int pfd;
127 char *slave;
127 128
128 *ttydev = _getpty (&pfd, O_RDWR | O_NONBLOCK | O_NOCTTY, 0622, 0); 129 slave = _getpty (&pfd, O_RDWR | O_NONBLOCK | O_NOCTTY, 0622, 0);
129 130
130 if (*ttydev != NULL) 131 if (slave != NULL) {
132 *ttydev = strdup (slave);
131 return pfd; 133 return pfd;
134 }
132 135
133 return -1; 136 return -1;
134 } 137 }
135 138
136#elif defined(HAVE_DEV_PTC) 139#elif defined(HAVE_DEV_PTC)
327 { /* change group ownership of tty to "tty" */ 330 { /* change group ownership of tty to "tty" */
328 mode = S_IRUSR | S_IWUSR | S_IWGRP; 331 mode = S_IRUSR | S_IWUSR | S_IWGRP;
329 gid = gr->gr_gid; 332 gid = gr->gr_gid;
330 } 333 }
331 else 334 else
332#endif /* TTY_GID_SUPPORT */ 335#endif /* TTY_GID_SUPPORT */
333 { 336 {
334 mode = S_IRUSR | S_IWUSR | S_IWGRP | S_IWOTH; 337 mode = S_IRUSR | S_IWUSR | S_IWGRP | S_IWOTH;
335 gid = 0; 338 gid = 0;
336 } 339 }
337 } 340 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines