Commit f275a817 authored by Niels Möller's avatar Niels Möller
Browse files

Deleted some dead code.

Rev: src/client.c:1.133
Rev: src/gc.c:1.26
Rev: src/gc.h:1.11
Rev: src/io.c:1.152
Rev: src/io.h:1.82
Rev: src/io_commands.c:1.49
Rev: src/io_commands.h:1.23
Rev: src/lsh.c:1.151
Rev: src/read_file.c:1.3
Rev: src/reaper.c:1.22
Rev: src/unix_interact.c:1.13
parent eb3f8a14
......@@ -1100,25 +1100,6 @@ client_argp_parser(int key, char *arg, struct argp_state *state)
break;
}
#if 0
case 'R':
{
UINT32 listen_port;
struct address_info *target;
if (!client_parse_forward_arg(arg, &listen_port, &target))
argp_error(state, "Invalid forward specification '%s'.", arg);
client_add_action(options, make_forward_remote_port
(make_address_info((options->with_remote_peers
? ssh_format("%lz", "0.0.0.0")
: ssh_format("%lz", "127.0.0.1")),
listen_port),
target));
options->remote_forward = 1;
break;
}
#endif
case 'N':
options->start_shell = 0;
break;
......
......@@ -253,32 +253,15 @@ void gc(void)
#endif
}
#if 0
void gc_maybe(int busy)
{
sanity_check_object_list();
if (number_of_objects > (100 + live_objects*(2+busy)))
{
verbose("Garbage collecting while %z...\n", busy ? "busy" : "idle");
gc();
}
}
#endif
/* Deallocate all objects. */
#if DEBUG_ALLOC
int gc_final_p = 0;
#endif
void gc_final(void)
{
KILL_RESOURCE_LIST(root_set);
root_set = NULL;
#if DEBUG_ALLOC
gc_final_p = 1;
gc_sweep();
assert(!number_of_objects);
......
......@@ -34,11 +34,6 @@ void gc_kill(struct lsh_object *o);
void gc_global(struct resource *o);
void gc(void);
void gc_maybe(int busy);
#if DEBUG_ALLOC
extern int gc_final_p;
#endif
void gc_final(void);
......
......@@ -771,37 +771,6 @@ do_exc_io_handler(struct exception_handler *self,
return;
}
#if 0
/* Initializes a file structure, and adds it to the backend's list. */
static void
init_file(struct io_backend *b, struct lsh_fd *f, int fd,
const char *label,
struct exception_handler *e)
{
init_resource(&f->super, do_kill_fd);
f->fd = fd;
f->label = label;
f->e = make_exception_handler(do_exc_io_handler, e, HANDLER_CONTEXT);
f->close_callback = NULL;
f->prepare = NULL;
f->hanged_up = 0;
f->want_read = 0;
f->read = NULL;
f->want_write = 0;
f->write = NULL;
f->write_close = NULL;
f->next = b->files;
b->files = f;
}
#endif
/* These functions are used by werror and friends */
......
......@@ -44,11 +44,6 @@
#include "io.h.x"
#undef GABA_DECLARE
#if 0
/* Declare the class object, so that io_commands.c can refer to it for
* type-checking. */
extern struct lsh_class io_backend_class;
#endif
/* GABA:
(class
......@@ -229,14 +224,6 @@ io_final(void);
void io_run(void);
#if 0
void
lsh_oop_register_signal(struct lsh_signal_handler *handler);
void
lsh_oop_cancel_signal(struct lsh_signal_handler *handler);
#endif
void
lsh_oop_register_read_fd(struct lsh_fd *fd);
......
......@@ -47,13 +47,6 @@
#include "io_commands.c.x"
/* Used only by lsh-writekey */
/* ;; GABA:
(class
(name backend_command)
(super command)
(vars
(backend object io_backend)))
*/
/* (write file_info)
*
......@@ -80,23 +73,6 @@ DEFINE_COMMAND(io_write_file_command)
EXCEPTION_RAISE(e, make_io_exception(EXC_IO_OPEN_WRITE, NULL, errno, NULL));
}
#if 0
DEFINE_COMMAND(io_write_file_command)
(struct command *s UNUSED,
struct lsh_object *a,
struct command_continuation *c,
struct exception_handler *e UNUSED)
{
CAST(io_backend, backend, a);
NEW(backend_command, self);
self->super.call = do_io_write_file;
self->backend = backend;
COMMAND_RETURN(c, self);
}
#endif
struct io_write_file_info *
make_io_write_file_info(struct lsh_string *name, int flags, int mode, UINT32 block_size)
{
......
......@@ -50,28 +50,6 @@ extern struct command io_write_file_command;
#define IO_WRITE_FILE (&io_write_file_command.super)
#if 0
/* Read a certain fd */
/* ;;GABA:
(class
(name io_read_fd)
(super command)
(vars
(fd . int)))
*/
void do_io_read_fd(struct command *s,
struct lsh_object *a,
struct command_continuation *c,
struct exception_handler *e);
#define STATIC_IO_READ_FD(fd) \
{ STATIC_COMMAND(do_io_read_fd), fd }
extern struct io_read_fd io_read_stdin;
#define IO_READ_STDIN (&io_read_stdin.super.super)
#endif
struct command *
make_listen_with_callback(struct command *callback);
......
......@@ -614,13 +614,6 @@ main_options[] =
"Enable DH support (default, unless SRP is being used).", 0 },
{ "no-dh-keyexchange", OPT_DH | ARG_NOT, NULL, 0, "Disable DH support.", 0 },
#if 0
{ "userauth", OPT_USERAUTH, NULL, 0,
"Request the ssh-userauth service (default, unless SRP is being used).", 0 },
{ "no-userauth", OPT_USERAUTH | ARG_NOT, NULL, 0,
"Request the ssh-userauth service (default if SRP is used).", 0 },
#endif
/* Actions */
{ "forward-remote-port", 'R', "remote-port:target-host:target-port",
......
......@@ -77,10 +77,6 @@ do_read_file(struct read_handler **h,
A_WRITE(self->c, self->buffer);
self->buffer = NULL;
#if 0
if (available > left)
A_WRITE(self->c, NULL);
#endif
*h = NULL;
return available;
}
......
......@@ -44,17 +44,6 @@
#include "reaper.c.x"
#if 0
static volatile sig_atomic_t halloween;
static void child_handler(int signum)
{
assert(signum == SIGCHLD);
halloween = 1;
}
#endif
/* GABA:
(class
(name reaper)
......@@ -164,26 +153,6 @@ make_reaper_callback(struct reaper *reaper)
return &self->super;
}
#if 0
static void
reaper_install_handler(struct reaper *reaper,
struct io_backend *b)
{
struct sigaction chld;
memset(&chld, 0, sizeof(chld));
chld.sa_handler = child_handler;
sigemptyset(&chld.sa_mask);
chld.sa_flags = SA_NOCLDSTOP;
halloween = 0;
if (sigaction(SIGCHLD, &chld, NULL) < 0)
fatal("Failed to install handler for SIGCHLD.\n");
io_signal_handler(b, &halloween, make_reaper_callback(reaper));
}
#endif
struct reap *
make_reaper(void)
{
......
......@@ -49,17 +49,6 @@
#include "unix_interact.c.x"
#if 0
static volatile sig_atomic_t window_changed;
static void winch_handler(int signum)
{
assert(signum == SIGWINCH);
window_changed = 1;
}
#endif
/* Depends on the tty being line buffered */
static int
read_line(int fd, UINT32 size, UINT8 *buffer)
......@@ -413,10 +402,6 @@ make_unix_interact(void)
self->super.window_size = unix_window_size;
self->super.window_change_subscribe = unix_window_change_subscribe;
#if 0
window_changed = 0;
#endif
self->tty_fd = -1;
#if HAVE_STDTTY_FILENO
......@@ -427,23 +412,8 @@ make_unix_interact(void)
#endif
if (self->tty_fd >= 0)
{
/* Track window changes. */
#if 0
struct sigaction winch;
memset(&winch, 0, sizeof(winch));
winch.sa_handler = winch_handler;
sigemptyset(&winch.sa_mask);
winch.sa_flags = 0;
if (sigaction(SIGWINCH, &winch, NULL) < 0)
werror("Failed to install SIGWINCH handler (errno = %i): %z\n",
errno, STRERROR(errno));
#endif
suspend_handle_tty(self->tty_fd);
}
/* Restore and reset tty if process is suspended. */
suspend_handle_tty(self->tty_fd);
return &self->super;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment