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

Comparing rxvt-unicode/src/ptytty.C (file contents):
Revision 1.65 by ayin, Tue Jun 26 21:30:10 2007 UTC vs.
Revision 1.66 by ayin, Thu Jun 28 17:47:14 2007 UTC

104 static int 104 static int
105 get_pty (int *fd_tty, char **ttydev) 105 get_pty (int *fd_tty, char **ttydev)
106 { 106 {
107 int pfd; 107 int pfd;
108 int res; 108 int res;
109 char tty_name[32];
110 109
111 res = openpty (&pfd, fd_tty, tty_name, NULL, NULL); 110 res = openpty (&pfd, fd_tty, NULL, NULL, NULL);
112 111
113 if (res != -1) 112 if (res != -1)
114 { 113 {
115 *ttydev = strdup (tty_name); 114 *ttydev = strdup (ttyname (*fd_tty));
116 return pfd; 115 return pfd;
117 } 116 }
118 117
119 return -1; 118 return -1;
120 } 119 }
123 122
124 static int 123 static int
125 get_pty (int *fd_tty, char **ttydev) 124 get_pty (int *fd_tty, char **ttydev)
126 { 125 {
127 int pfd; 126 int pfd;
127 char *slave;
128 128
129 *ttydev = _getpty (&pfd, O_RDWR | O_NONBLOCK | O_NOCTTY, 0622, 0); 129 slave = _getpty (&pfd, O_RDWR | O_NONBLOCK | O_NOCTTY, 0622, 0);
130 130
131 if (*ttydev != NULL) 131 if (slave != NULL) {
132 *ttydev = strdup (slave);
132 return pfd; 133 return pfd;
134 }
133 135
134 return -1; 136 return -1;
135 } 137 }
136 138
137#elif defined(HAVE_DEV_PTC) 139#elif defined(HAVE_DEV_PTC)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines