diff options
author | james <> | 2008-02-13 09:12:21 +0000 |
---|---|---|
committer | james <> | 2008-02-13 09:12:21 +0000 |
commit | 23dc931ca671e938da071d24d8e9b6052e49923a (patch) | |
tree | f60e7ebd00db56a2757479334f4c8742cd6fcc13 /src/ptty.c | |
parent | 4d50b220e63c52d412bacebb3e44cc712f2e2804 (diff) | |
download | sympathy-23dc931ca671e938da071d24d8e9b6052e49923a.tar.gz sympathy-23dc931ca671e938da071d24d8e9b6052e49923a.tar.bz2 sympathy-23dc931ca671e938da071d24d8e9b6052e49923a.zip |
*** empty log message ***
Diffstat (limited to 'src/ptty.c')
-rw-r--r-- | src/ptty.c | 31 |
1 files changed, 18 insertions, 13 deletions
@@ -10,6 +10,9 @@ static char rcsid[] = "$Id$"; /* * $Log$ + * Revision 1.3 2008/02/13 09:12:21 james + * *** empty log message *** + * * Revision 1.2 2008/02/12 22:36:46 james * *** empty log message *** * @@ -118,14 +121,20 @@ ptty_open (char *path, char *argv[]) struct winsize winsize = { 0 }; struct termios termios; int fd; - char *default_argv = { "-", (char *) 0 }; + char *default_argv[] = { "-", (char *) 0 }; + + + default_termios (&termios); + + winsize.ws_row = VT102_ROWS; + winsize.ws_col = VT102_COLS; child = forkpty (&fd, name, &termios, &winsize); switch (child) { case -1: /*boo hiss */ - return -1; + return NULL; case 0: /*waaah */ setenv ("TERM", "vt102", 1); setenv ("LANG", "C", 1); @@ -146,19 +155,15 @@ ptty_open (char *path, char *argv[]) strncpy (t->name, name, sizeof (t->name)); t->name[sizeof (t->name) - 1] = 0; - t->read = ptty_read; - t->write = ptty_write; + t->recv = ptty_read; + t->xmit = ptty_write; t->close = ptty_close; - - default_termios (&termios); - - winsize.ws_row = VT102_ROWS; - winsize.ws_col = VT102_COLS; - - t->fd = open_fd_to_pty (path, argv); - t->pid = child; + t->fd = fd; + t->child = child; t->rfd = t->fd; - t->wfd = 0; + t->wfd = t->fd; + t->size.x = winsize.ws_row; + t->size.y = winsize.ws_col; return (TTY *) t; } |