diff options
author | Marcus Brinkmann <marcus@gnu.org> | 2002-08-30 00:46:23 +0000 |
---|---|---|
committer | Marcus Brinkmann <marcus@gnu.org> | 2002-08-30 00:46:23 +0000 |
commit | d9c3d20defca789463e6763f3eaf71585eedbf9a (patch) | |
tree | 7f2f1b1e0abfbff1d1fef2693eba50fbe7d082c1 /console | |
parent | 12f1c4e67f7ecaa3181912b5c18539e4e43138ce (diff) |
2002-08-30 Marcus Brinkmann <marcus@gnu.org>
* console.c (parse_opt): If STATE->input is zero, use
netfs_root_node's hook to cons.
Diffstat (limited to 'console')
-rw-r--r-- | console/ChangeLog | 3 | ||||
-rw-r--r-- | console/console.c | 14 |
2 files changed, 11 insertions, 6 deletions
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 <marcus@gnu.org> * 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); |