repo: rxvt-unicode-sixel action: commit revision: path_from: revision_from: 803a85f993dc61a661cd37a3c2c8c9a8f0171bf1: path_to: revision_to:
commit 803a85f993dc61a661cd37a3c2c8c9a8f0171bf1 Author: Marc LehmannDate: Fri Jan 6 02:11:15 2006 +0000 *** empty log message *** diff --git a/src/init.C b/src/init.C
--- 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
--- 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
--- 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
--- 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)
-----END OF PAGE-----