From 132c62de3caad3a9c7de679854f8eb214ad0ce8e Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Sun, 21 Mar 2004 19:57:00 +0000 Subject: 2004-03-21 Marco Gerards * console.c (main): Make sure the arguments are parsed in order. * driver.c (driver_add): Set up argc and argv so they can be used by argp. * generic-speaker.c: Include and . (struct melody): New member `name'. Every melody was given a name. (BELL_CLASSIC, BELL_LINUX, BELL_ALARM, BELL_CMAJOR): New macros. (doc, options, argp): New variables. (parse_opt): New function. (generic_speaker_init): Parse the arguments using argp. * vga.c (doc, options, argp): New variables. (parse_opt): New function. (parse_startup_args): Function removed. (vga_display_init): Use argp_parse instead of parse_startup_args. --- console-client/driver.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'console-client/driver.c') diff --git a/console-client/driver.c b/console-client/driver.c index 5c4630a0..15b6f185 100644 --- a/console-client/driver.c +++ b/console-client/driver.c @@ -1,5 +1,5 @@ /* driver.c - The console client driver code. - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2004 Free Software Foundation, Inc. Written by Marcus Brinkmann. This file is part of the GNU Hurd. @@ -99,6 +99,7 @@ error_t driver_add (const char *const name, const char *const driver, unsigned int i; char *dir = driver_path; int defpath = 0; + char *opt_backup; mutex_lock (&driver_list_lock); for (i = 0; i < driver_list_len; i++) @@ -213,8 +214,13 @@ error_t driver_add (const char *const name, const char *const driver, return ENOMEM; } + opt_backup = argv[*next - 1]; + argv[*next - 1] = (char *) name; /* If we will start the driver, the init function must not exit. */ - err = (*drv->ops->init) (&drv->handle, start, argc, argv, next); + err = (*drv->ops->init) (&drv->handle, start, argc - (*next - 1), + argv + *next - 1, next); + argv[*next - 1] = opt_backup; + if (!err && start && drv->ops->start) err = (*drv->ops->start) (drv->handle); if (err) -- cgit v1.2.3