bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: patch to enable --help in /hurd/init


From: Marcus Brinkmann
Subject: Re: patch to enable --help in /hurd/init
Date: Thu, 24 Feb 2005 02:57:33 +0100
User-agent: Wanderlust/2.10.1 (Watching The Wheels) SEMI/1.14.6 (Maruoka) FLIM/1.14.6 (Marutamachi) APEL/10.6 Emacs/21.3 (i386-pc-linux-gnu) MULE/5.0 (SAKAKI)

Hi,

Looks good to me.  I have committed it, but I put the comment before
the calculation of flags.  I also added a small comment about the
issue into the code.

Thanks,
Marcus

At Wed, 23 Feb 2005 17:48:29 -0500,
Ben Asselstine <benasselstine@gmail.com> wrote:
> 
> * init.c (main): Only pass ARGP_NO_ERRS to argp_parse when invoked by
> the bootstrap filesystem.
> (flags): New variable.
> 
> diff -u -N -r -p hurd.orig/init/init.c hurd/init/init.c
> --- hurd.orig/init/init.c       2005-02-23 04:43:40.000000000 -0500
> +++ hurd/init/init.c    2005-02-23 09:44:36.000000000 -0500
> @@ -529,13 +529,18 @@ main (int argc, char **argv, char **envp
>  {
>    volatile int err;
>    int i;
> +  int flags;
>    mach_port_t consdev;
>    struct argp argp = { options, parse_opt, 0, doc };
> 
> +  flags = ARGP_IN_ORDER;
> +  if (getpid () == 0)
> +    flags |= ARGP_NO_ERRS;
> +
>    /* Parse the arguments.  We don't want the vector reordered,
>       we should pass on to our child the exact arguments we got
>       and just ignore any arguments that aren't flags for us.  */
> -  argp_parse (&argp, argc, argv, ARGP_NO_ERRS|ARGP_IN_ORDER, 0, 0);
> +  argp_parse (&argp, argc, argv, flags, 0, 0);
> 
>    if (getpid () > 0)
>      error (2, 0, "can only be run by bootstrap filesystem");
> 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]