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.27 by root, Tue Jan 3 16:32:33 2006 UTC vs.
Revision 1.29 by root, Fri Jan 6 02:11:15 2006 UTC

396 396
397void 397void
398 398
399rxvt_ptytty::close_tty () 399rxvt_ptytty::close_tty ()
400{ 400{
401 if (tty >= 0) close (tty); 401 if (tty < 0)
402 return;
403
404 close (tty);
402 tty = -1; 405 tty = -1;
403} 406}
404 407
405void 408void
406rxvt_ptytty::put () 409rxvt_ptytty::put ()
407{ 410{
408#ifndef NO_SETOWNER_TTYDEV 411#ifndef NO_SETOWNER_TTYDEV
409 if (tty >= 0)
410 privileges (RESTORE); 412 privileges (RESTORE);
411#endif 413#endif
412 414
413 if (pty >= 0) close (pty); 415 if (pty >= 0) close (pty);
414 close_tty (); 416 close_tty ();
415 free (name); 417 free (name);
452 454
453void 455void
454rxvt_ptytty::set_utf8_mode (bool on) 456rxvt_ptytty::set_utf8_mode (bool on)
455{ 457{
456#ifdef IUTF8 458#ifdef IUTF8
457 if (pty != -1) 459 if (pty < 0)
458 { 460 return;
461
459 struct termios tio; 462 struct termios tio;
460 463
461 if (tcgetattr (pty, &tio) != -1) 464 if (tcgetattr (pty, &tio) != -1)
465 {
466 tcflag_t new_cflag = tio.c_iflag;
467
468 if (on)
469 new_cflag |= IUTF8;
470 else
471 new_cflag &= ~IUTF8;
472
473 if (new_cflag != tio.c_iflag)
462 { 474 {
463 tcflag_t new_cflag = tio.c_iflag;
464
465 if (on)
466 new_cflag |= IUTF8;
467 else
468 new_cflag &= ~IUTF8;
469
470 if (new_cflag != tio.c_iflag)
471 {
472 tio.c_iflag = new_cflag; 475 tio.c_iflag = new_cflag;
473 tcsetattr (pty, TCSANOW, &tio); 476 tcsetattr (pty, TCSANOW, &tio);
474 }
475 } 477 }
476 } 478 }
477#endif 479#endif
478} 480}
479 481

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines