*** empty log message ***
authorroot <root>
Fri, 6 Jan 2006 02:11:15 +0000 (02:11 +0000)
committerroot <root>
Fri, 6 Jan 2006 02:11:15 +0000 (02:11 +0000)
src/init.C
src/main.C
src/ptytty.C
src/rxvttoolkit.C

index c2e76c5f7be5159e9fe65da54610b62ac1d9942a..f0fcffd975048270f932ee5fe90869dd91e54e9a 100644 (file)
@@ -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
index 03c1e64a05203360d8903c0a53edf5c76a49e521..3578f9fedf966e1cb5f1770a6bed54ca82b7cb3f 100644 (file)
@@ -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 ();
 
index f09139153e4796148c2a0f0fcc5274d73eade034..b56737a749bcb8bb790fbc2344d735a04a0b4786 100644 (file)
@@ -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
index c35fb73482cca7508a11a434660ee55d0b22e24a..71025707a6df1464bfc8e7c2ec390da69c495b4d 100644 (file)
@@ -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)