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.2 by pcg, Mon Nov 24 17:31:27 2003 UTC vs.
Revision 1.3 by pcg, Tue Nov 25 15:25:17 2003 UTC

1/*--------------------------------*-C-*---------------------------------* 1/*--------------------------------*-C-*---------------------------------*
2 * File: ptytty.c 2 * File: ptytty.c
3 *----------------------------------------------------------------------* 3 *----------------------------------------------------------------------*
4 * $Id: ptytty.C,v 1.2 2003/11/24 17:31:27 pcg Exp $ 4 * $Id: ptytty.C,v 1.3 2003/11/25 15:25:17 pcg Exp $
5 * 5 *
6 * All portions of code are copyright by their respective author/s. 6 * All portions of code are copyright by their respective author/s.
7 * Copyright (c) 1999-2001 Geoff Wing <gcw@pobox.com> 7 * Copyright (c) 1999-2001 Geoff Wing <gcw@pobox.com>
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
67 */ 67 */
68/* EXTPROTO */ 68/* EXTPROTO */
69int 69int
70rxvt_get_pty(int *fd_tty, const char **ttydev) 70rxvt_get_pty(int *fd_tty, const char **ttydev)
71{ 71{
72 int pfd; 72 int pfd;
73 73
74#ifdef PTYS_ARE_OPENPTY 74#ifdef PTYS_ARE_OPENPTY
75 char tty_name[sizeof "/dev/pts/????\0"]; 75 char tty_name[sizeof "/dev/pts/????\0"];
76 76
77 if (openpty(&pfd, fd_tty, tty_name, NULL, NULL) != -1) { 77 if (openpty(&pfd, fd_tty, tty_name, NULL, NULL) != -1) {
78 *ttydev = strdup(tty_name); 78 *ttydev = strdup(tty_name);
79 return pfd; 79 return pfd;
80 } 80 }
81#endif 81#endif
82 82
83#ifdef PTYS_ARE__GETPTY 83#ifdef PTYS_ARE__GETPTY
84 *ttydev = _getpty(&pfd, O_RDWR | O_NDELAY | O_NOCTTY, 0622, 0); 84 *ttydev = _getpty(&pfd, O_RDWR | O_NONBLOCK | O_NOCTTY, 0622, 0);
85 if (*ttydev != NULL) 85 if (*ttydev != NULL)
86 return pfd; 86 return pfd;
87#endif 87#endif
88 88
89#ifdef PTYS_ARE_GETPTY 89#ifdef PTYS_ARE_GETPTY

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines