From d9c3d20defca789463e6763f3eaf71585eedbf9a Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Fri, 30 Aug 2002 00:46:23 +0000 Subject: 2002-08-30 Marcus Brinkmann * console.c (parse_opt): If STATE->input is zero, use netfs_root_node's hook to cons. --- console/ChangeLog | 3 +++ console/console.c | 14 ++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) (limited to 'console') diff --git a/console/ChangeLog b/console/ChangeLog index b5726620..a7c8ca7d 100644 --- a/console/ChangeLog +++ b/console/ChangeLog @@ -18,6 +18,9 @@ (main): Set default colors and attributes. (parse_attributes): New function. + * console.c (parse_opt): If STATE->input is zero, use + netfs_root_node's hook to cons. + 2002-08-28 Marcus Brinkmann * display.c (screen_fill): Take CUR_LINES modulo LINES. diff --git a/console/console.c b/console/console.c index 0e2ebbc9..3896f361 100644 --- a/console/console.c +++ b/console/console.c @@ -1403,7 +1403,7 @@ parse_attributes (const char *name, conchar_attr_t *attr) static error_t parse_opt (int opt, char *arg, struct argp_state *state) { - cons_t cons = state->input; + cons_t cons = state->input ?: netfs_root_node->nn->cons; error_t err; int color = 0; @@ -1874,7 +1874,11 @@ console_demuxer (mach_msg_header_t *inp, return (netfs_demuxer (inp, outp) || tioctl_server (inp, outp)); } - + +const struct argp netfs_std_runtime_argp = + { options, parse_opt, NULL, + "A translator that provides virtual consoles." }; + int main (int argc, char **argv) { @@ -1883,8 +1887,6 @@ main (int argc, char **argv) struct stat ul_stat; cons_t cons; struct netnode root_nn = { vcons: 0 }; - struct argp argp = { options, parse_opt, NULL, - "A translator that provides virtual consoles." }; cons = malloc (sizeof (struct cons)); if (!malloc) @@ -1903,8 +1905,8 @@ main (int argc, char **argv) cons->dirmod_tick = 0; root_nn.cons = cons; - /* Parse our command line arguments (all none of them). */ - argp_parse (&argp, argc, argv, 0, 0, cons); + /* Parse our command line arguments. */ + argp_parse (&netfs_std_runtime_argp, argc, argv, 0, 0, cons); task_get_bootstrap_port (mach_task_self (), &bootstrap); -- cgit v1.2.3