*** empty log message ***
authorroot <root>
Tue, 17 Jan 2006 12:22:59 +0000 (12:22 +0000)
committerroot <root>
Tue, 17 Jan 2006 12:22:59 +0000 (12:22 +0000)
configure
src/command.C
src/init.C
src/main.C
src/ptytty.C
src/ptytty.h
src/rxvt.h
src/rxvtlib.h.in

index 5506a10b4cf5a6813c85b573b8210f10424536a0..6bfda158aa0a870d30c9f135c708d8308653ff71 100755 (executable)
--- a/configure
+++ b/configure
@@ -1371,9 +1371,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
+
+          ac_config_headers="$ac_config_headers config.h:config.h.in"
+
 
 ac_aux_dir=
-for ac_dir in autoconf $srcdir/autoconf; do
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
   if test -f $ac_dir/install-sh; then
     ac_aux_dir=$ac_dir
     ac_install_sh="$ac_aux_dir/install-sh -c"
@@ -1389,17 +1392,14 @@ for ac_dir in autoconf $srcdir/autoconf; do
   fi
 done
 if test -z "$ac_aux_dir"; then
-  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in autoconf $srcdir/autoconf" >&5
-echo "$as_me: error: cannot find install-sh or install.sh in autoconf $srcdir/autoconf" >&2;}
+  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
+echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
    { (exit 1); exit 1; }; }
 fi
 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
 
-          ac_config_headers="$ac_config_headers config.h:autoconf/config.h.in"
-
-
 # Make sure we can run config.sub.
 $ac_config_sub sun4 >/dev/null 2>&1 ||
   { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
@@ -10132,6 +10132,15 @@ _ACEOF
 
 
 
+case "$host_alias" in
+    *ultrix) ac_cv_func_setsid='no' ;;
+    *) break;;
+esac
+
+
+
+
+
 
 
 
@@ -10149,11 +10158,15 @@ _ACEOF
 
 
 for ac_func in \
+       atexit \
        revoke \
        unsetenv \
        setutent \
        seteuid \
        setreuid \
+       setsid \
+       setpgrp \
+       setpgid \
        _getpty \
        getpt \
        posix_openpt \
@@ -13518,7 +13531,7 @@ do
   "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
   "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
   "src/rxvtlib.h" ) CONFIG_FILES="$CONFIG_FILES src/rxvtlib.h" ;;
-  "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:autoconf/config.h.in" ;;
+  "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.h.in" ;;
   *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
    { (exit 1); exit 1; }; };;
index f0226d46c22cfd2ee80d29ae738ba3a5b9a25b1f..b303e8934cc9648221e419a29555fa9c9fa26841 100644 (file)
@@ -1139,7 +1139,7 @@ rxvt_term::pty_fill ()
   cmdbuf_ptr = cmdbuf_base;
   cmdbuf_endp = cmdbuf_ptr + n;
 
-  ssize_t r = read (pty.pty, cmdbuf_endp, CBUFSIZ - n);
+  ssize_t r = read (pty->pty, cmdbuf_endp, CBUFSIZ - n);
 
   if (r > 0)
     {
@@ -3971,7 +3971,7 @@ rxvt_term::process_xterm_seq (int op, const char *str, char resp)
         else
           {
             set_locale (str);
-            pty.set_utf8_mode (enc_utf8);
+            pty->set_utf8_mode (enc_utf8);
             init_xlocale ();
           }
         break;
@@ -4413,12 +4413,12 @@ rxvt_term::tt_write (const char *data, unsigned int len)
   if (HOOK_INVOKE ((this, HOOK_TT_WRITE, DT_STR_LEN, data, len, DT_END)))
     return;
 
-  if (pty.pty < 0)
+  if (pty->pty < 0)
     return;
 
   if (v_buflen == 0)
     {
-      ssize_t written = write (pty.pty, data, min (len, MAX_PTY_WRITE));
+      ssize_t written = write (pty->pty, data, min (len, MAX_PTY_WRITE));
 
       if ((unsigned int)written == len)
         return;
@@ -4437,7 +4437,7 @@ rxvt_term::tt_write (const char *data, unsigned int len)
 
 void rxvt_term::pty_write ()
 {
-  int written = write (pty.pty, v_buffer, min (v_buflen, MAX_PTY_WRITE));
+  int written = write (pty->pty, v_buffer, min (v_buflen, MAX_PTY_WRITE));
 
   if (written > 0)
     {
index 207dab16b9b78c974f0afc9651b186da8b6a7871..adbc9805526ee21166f2e529f447cbf71dc3ccae 100644 (file)
@@ -1372,23 +1372,23 @@ rxvt_term::run_command (const char *const *argv)
 #if ENABLE_FRILLS
   if (rs[Rs_pty_fd])
     {
-      pty.pty = atoi (rs[Rs_pty_fd]);
+      pty->pty = atoi (rs[Rs_pty_fd]);
 
-      if (pty.pty >= 0)
+      if (pty->pty >= 0)
         {
           if (getfd_hook)
-            pty.pty = (*getfd_hook) (pty.pty);
+            pty->pty = (*getfd_hook) (pty->pty);
 
-          if (pty.pty < 0 || fcntl (pty.pty, F_SETFL, O_NONBLOCK))
+          if (pty->pty < 0 || fcntl (pty->pty, F_SETFL, O_NONBLOCK))
             rxvt_fatal ("unusable pty-fd filehandle, aborting.\n");
         }
     }
   else
 #endif
-    if (!pty.get ())
+    if (!pty->get ())
       rxvt_fatal ("can't initialize pseudo-tty, aborting.\n");
 
-  pty.set_utf8_mode (enc_utf8);
+  pty->set_utf8_mode (enc_utf8);
 
   /* set initial window size */
   tt_winch ();
@@ -1422,20 +1422,20 @@ rxvt_term::run_command (const char *const *argv)
       case 0:
         init_env ();
 
-        if (!pty.make_controlling_tty ())
+        if (!pty->make_controlling_tty ())
           fprintf (stderr, "%s: could not obtain control of tty.", RESNAME);
         else
           {
             /* Reopen stdin, stdout and stderr over the tty file descriptor */
-            dup2 (pty.tty, STDIN_FILENO);
-            dup2 (pty.tty, STDOUT_FILENO);
-            dup2 (pty.tty, STDERR_FILENO);
+            dup2 (pty->tty, STDIN_FILENO);
+            dup2 (pty->tty, STDOUT_FILENO);
+            dup2 (pty->tty, STDERR_FILENO);
 
             // close all our file handles that we do no longer need
             for (rxvt_term **t = termlist.begin (); t < termlist.end (); t++)
               {
-                if ((*t)->pty.pty > 2) close ((*t)->pty.pty);
-                if ((*t)->pty.tty > 2) close ((*t)->pty.tty);
+                if ((*t)->pty->pty > 2) close ((*t)->pty->pty);
+                if ((*t)->pty->tty > 2) close ((*t)->pty->tty);
               }
 
             run_child (argv);
@@ -1450,7 +1450,7 @@ rxvt_term::run_command (const char *const *argv)
           int fdstdin;
 
           fdstdin = dup (STDIN_FILENO);
-          dup2 (pty.tty, STDIN_FILENO);
+          dup2 (pty->tty, STDIN_FILENO);
 #endif
 
 #ifdef UTMP_SUPPORT
@@ -1464,7 +1464,7 @@ rxvt_term::run_command (const char *const *argv)
 #endif
         }
 
-        pty.close_tty ();   /* keep STDERR_FILENO, pty.pty, display->fd () open */
+        pty->close_tty ();
         break;
     }
 }
index 9a488f2c0eafc18559b373a203672b049ffe36dc..0bfadb688858d8d0494e33a406c7940665444aca 100644 (file)
@@ -215,7 +215,7 @@ void rxvt_term::emergency_cleanup ()
   privileged_utmp (RESTORE);
 #endif
 
-  pty.put ();
+  delete pty; pty = 0;
 }
 
 rxvt_term::~rxvt_term ()
@@ -511,6 +511,8 @@ rxvt_term::init (int argc, const char *const *argv)
     }
 #endif
 
+  pty = rxvt_new_ptytty ();
+
   create_windows (argc, argv);
 
   dDisp;
@@ -545,8 +547,8 @@ rxvt_term::init (int argc, const char *const *argv)
 
   free (cmd_argv);
 
-  if (pty.pty >= 0)
-    pty_ev.start (pty.pty, EVENT_READ);
+  if (pty->pty >= 0)
+    pty_ev.start (pty->pty, EVENT_READ);
 
   check_ev.start ();
 
@@ -725,9 +727,9 @@ rxvt_term::privileged_utmp (rxvt_privaction action)
   rxvt_privileges (RESTORE);
 
   if (action == SAVE)
-    pty.login (cmd_pid, OPTION (Opt_loginShell), rs[Rs_display_name]);
+    pty->login (cmd_pid, OPTION (Opt_loginShell), rs[Rs_display_name]);
   else
-    pty.logout ();
+    pty->logout ();
 
   rxvt_privileges (IGNORE);
 }
@@ -875,7 +877,7 @@ rxvt_term::window_calc (unsigned int newwidth, unsigned int newheight)
 void
 rxvt_term::tt_winch ()
 {
-  if (pty.pty < 0)
+  if (pty->pty < 0)
     return;
 
   struct winsize ws;
@@ -884,7 +886,7 @@ rxvt_term::tt_winch ()
   ws.ws_row = nrow;
   ws.ws_xpixel = width;
   ws.ws_ypixel = height;
-  (void)ioctl (pty.pty, TIOCSWINSZ, &ws);
+  (void)ioctl (pty->pty, TIOCSWINSZ, &ws);
 
 #if 0
   // TIOCSWINSZ⎈ is supposed to do this automatically and correctly
index d8fa3bd271f83cea4e67c7c7800689a82a6a54d8..bab59bde1ef5ed2ef307a3ed69887335f8ab6b8e 100644 (file)
@@ -56,6 +56,8 @@
 #include <cstdio>
 #include <grp.h>
 
+#include "ptytty.h"
+
 /////////////////////////////////////////////////////////////////////////////
 
 /* ------------------------------------------------------------------------- *
@@ -443,5 +445,11 @@ rxvt_ptytty_unix::get ()
   return true;
 }
 
+// a "factory" *g*
+rxvt_ptytty *rxvt_new_ptytty ()
+{
+   return new rxvt_ptytty_unix;
+}
+
 /*----------------------- end-of-file (C source) -----------------------*/
 
index 8bbbba3fe9e83becfc77b9d9121917395a910e21..2605d2cc111fafba30901894ca6deb76b194f314 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef PTYTTY_H
 #define PTYTTY_H
 
+#include "rxvt.h"
 #include "feature.h"
 
 #if defined(HAVE_GRANTPT) && defined(HAVE_UNLOCKPT)
 
 #endif
 
-enum rxvt_privaction { IGNORE = 'i', SAVE = 's', RESTORE = 'r' };
-
-struct rxvt_ptytty {
-  int pty; // pty file descriptor; connected to rxvt
-  int tty; // tty file descriptor; connected to child
-
-  virtual ~rxvt_ptytty ()
-  {
-    //
-  }
-
-  virtual bool get () = 0;
-  virtual void put () = 0;
-
-  virtual void login (int cmd_pid, bool login_shell, const char *hostname) = 0;
-  virtual void logout () = 0;
-
-  void close_tty ();
-
-  bool make_controlling_tty ();
-  void set_utf8_mode (bool on);
-};
-
 struct rxvt_ptytty_unix : rxvt_ptytty {
   char *name;
 
index 3d43eb0c521fcd9b5e141baa16e6fc7672a2c737..205d5c9fdd09c61082c66988c240760d8ccb60fc 100644 (file)
@@ -96,6 +96,8 @@ typedef struct {
 # define STDERR_FILENO  2
 #endif
 
+enum rxvt_privaction { IGNORE = 'i', SAVE = 's', RESTORE = 'r' };//TODO
+
 /*
  *****************************************************************************
  * PROTOTYPES                    
@@ -174,6 +176,30 @@ typedef struct {
 } bgPixmap_t;
 #endif
 
+struct rxvt_ptytty {
+  int pty; // pty file descriptor; connected to rxvt
+  int tty; // tty file descriptor; connected to child
+
+  virtual ~rxvt_ptytty ()
+  {
+    //
+  }
+
+  virtual bool get () = 0;
+  virtual void put () = 0;
+
+  virtual void login (int cmd_pid, bool login_shell, const char *hostname) = 0;
+  virtual void logout () = 0;
+
+  void close_tty ();
+
+  bool make_controlling_tty ();
+  void set_utf8_mode (bool on);
+};
+
+// a "factory" *g*
+rxvt_ptytty *rxvt_new_ptytty ();
+
 /*
  * the 'essential' information for reporting Mouse Events
  * pared down from XButtonEvent
@@ -1124,7 +1150,7 @@ struct rxvt_term : zero_initialized, rxvt_vars {
   char           *cmdbuf_ptr, *cmdbuf_endp;
   char            cmdbuf_base[CBUFSIZ];
 
-  rxvt_ptytty_unix pty;
+  rxvt_ptytty    *pty;
 
   rxvt_salloc    *talloc;             // text line allocator
   rxvt_salloc    *ralloc;             // rend line allocator
index 0a8bd7ff2a1f95163349b1dbbb76d854df76ac66..6e8db26896a42dc8f73156a590e59bf8a36f7ea3 100644 (file)
@@ -30,8 +30,6 @@
 // stdlib.h might provide it
 #endif
 
-#include "ptytty.h"
-
 extern "C" {
 #include <X11/Intrinsic.h>      /* Xlib, Xutil, Xresource, Xfuncproto */
 }