+ 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"
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
+case "$host_alias" in
+ *ultrix) ac_cv_func_setsid='no' ;;
+ *) break;;
+esac
+
+
+
+
+
for ac_func in \
+ atexit \
revoke \
unsetenv \
setutent \
seteuid \
setreuid \
+ setsid \
+ setpgrp \
+ setpgid \
_getpty \
getpt \
posix_openpt \
"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; }; };;
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)
{
else
{
set_locale (str);
- pty.set_utf8_mode (enc_utf8);
+ pty->set_utf8_mode (enc_utf8);
init_xlocale ();
}
break;
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;
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)
{
#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 ();
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);
int fdstdin;
fdstdin = dup (STDIN_FILENO);
- dup2 (pty.tty, STDIN_FILENO);
+ dup2 (pty->tty, STDIN_FILENO);
#endif
#ifdef UTMP_SUPPORT
#endif
}
- pty.close_tty (); /* keep STDERR_FILENO, pty.pty, display->fd () open */
+ pty->close_tty ();
break;
}
}
privileged_utmp (RESTORE);
#endif
- pty.put ();
+ delete pty; pty = 0;
}
rxvt_term::~rxvt_term ()
}
#endif
+ pty = rxvt_new_ptytty ();
+
create_windows (argc, argv);
dDisp;
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 ();
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);
}
void
rxvt_term::tt_winch ()
{
- if (pty.pty < 0)
+ if (pty->pty < 0)
return;
struct winsize ws;
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
#include <cstdio>
#include <grp.h>
+#include "ptytty.h"
+
/////////////////////////////////////////////////////////////////////////////
/* ------------------------------------------------------------------------- *
return true;
}
+// a "factory" *g*
+rxvt_ptytty *rxvt_new_ptytty ()
+{
+ return new rxvt_ptytty_unix;
+}
+
/*----------------------- end-of-file (C source) -----------------------*/
#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;
# define STDERR_FILENO 2
#endif
+enum rxvt_privaction { IGNORE = 'i', SAVE = 's', RESTORE = 'r' };//TODO
+
/*
*****************************************************************************
* PROTOTYPES
} 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
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
// stdlib.h might provide it
#endif
-#include "ptytty.h"
-
extern "C" {
#include <X11/Intrinsic.h> /* Xlib, Xutil, Xresource, Xfuncproto */
}