From: root Date: Fri, 6 Jan 2006 02:11:15 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=3b28294ada7b82141aa71209893cf51870028f31;p=dana%2Furxvt.git *** empty log message *** --- diff --git a/src/init.C b/src/init.C index c2e76c5f..f0fcffd9 100644 --- a/src/init.C +++ b/src/init.C @@ -1404,11 +1404,14 @@ rxvt_term::run_command (const char *const *argv) { pty.pty = atoi (rs[Rs_pty_fd]); - if (getfd_hook) - pty.pty = (*getfd_hook) (pty.pty); + if (pty.pty >= 0) + { + if (getfd_hook) + pty.pty = (*getfd_hook) (pty.pty); - if (pty.pty < 0 || fcntl (pty.pty, F_SETFL, O_NONBLOCK)) - rxvt_fatal ("unusable pty-fd filehandle, aborting.\n"); + if (pty.pty < 0 || fcntl (pty.pty, F_SETFL, O_NONBLOCK)) + rxvt_fatal ("unusable pty-fd filehandle, aborting.\n"); + } } else #endif diff --git a/src/main.C b/src/main.C index 03c1e64a..3578f9fe 100644 --- a/src/main.C +++ b/src/main.C @@ -536,7 +536,8 @@ rxvt_term::init (int argc, const char *const *argv) free (cmd_argv); - pty_ev.start (pty.pty, EVENT_READ); + if (pty.pty >= 0) + pty_ev.start (pty.pty, EVENT_READ); check_ev.start (); diff --git a/src/ptytty.C b/src/ptytty.C index f0913915..b56737a7 100644 --- a/src/ptytty.C +++ b/src/ptytty.C @@ -398,7 +398,10 @@ void rxvt_ptytty::close_tty () { - if (tty >= 0) close (tty); + if (tty < 0) + return; + + close (tty); tty = -1; } @@ -453,24 +456,24 @@ void rxvt_ptytty::set_utf8_mode (bool on) { #ifdef IUTF8 - if (pty != -1) + if (pty < 0) + return; + + struct termios tio; + + if (tcgetattr (pty, &tio) != -1) { - struct termios tio; + tcflag_t new_cflag = tio.c_iflag; + + if (on) + new_cflag |= IUTF8; + else + new_cflag &= ~IUTF8; - if (tcgetattr (pty, &tio) != -1) + if (new_cflag != tio.c_iflag) { - tcflag_t new_cflag = tio.c_iflag; - - if (on) - new_cflag |= IUTF8; - else - new_cflag &= ~IUTF8; - - if (new_cflag != tio.c_iflag) - { - tio.c_iflag = new_cflag; - tcsetattr (pty, TCSANOW, &tio); - } + tio.c_iflag = new_cflag; + tcsetattr (pty, TCSANOW, &tio); } } #endif diff --git a/src/rxvttoolkit.C b/src/rxvttoolkit.C index c35fb734..71025707 100644 --- a/src/rxvttoolkit.C +++ b/src/rxvttoolkit.C @@ -281,7 +281,6 @@ void rxvt_display::x_cb (io_watcher &w, short revents) #ifdef USE_XIM if (!XFilterEvent (&xev, None)) { - if (xev.type == PropertyNotify && xev.xany.window == root && xev.xproperty.atom == xa_xim_servers)