bug-hurd
[Top][All Lists]
Advanced

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

Re: [PATCH 1/3] Add a new exec_exec_file_name RPC


From: Carl Fredrik Hammar
Subject: Re: [PATCH 1/3] Add a new exec_exec_file_name RPC
Date: Mon, 31 May 2010 17:59:09 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

On Wed, May 26, 2010 at 12:15:37AM +0200, Emilio Pozuelo Monfort wrote:
> diff --git a/exec/exec.c b/exec/exec.c
> index 272b789..6b0f721 100644
> --- a/exec/exec.c
> +++ b/exec/exec.c
> @@ -1,5 +1,5 @@
>  /* GNU Hurd standard exec server.
> -   Copyright (C) 1992,93,94,95,96,98,99,2000,01,02,04
> +   Copyright (C) 1992,93,94,95,96,98,99,2000,01,02,04,10
>       Free Software Foundation, Inc.
>     Written by Roland McGrath.

The current policy is to expand the old years when updating copyright
years, and make sure it is padded by blank lines.  In this case, it
should be something like:

+
+   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+   2002, 2004, 2010 Free Software Foundation, Inc.
+

Note that this only applies to the Hurd, not glibc.

> @@ -2052,6 +2054,40 @@ S_exec_exec (struct trivfs_protid *protid,
>            mach_port_t *deallocnames, mach_msg_type_number_t ndeallocnames,
>            mach_port_t *destroynames, mach_msg_type_number_t ndestroynames)
>  {
> +  return S_exec_exec_file_name (protid,
> +                             file,
> +                             oldtask,
> +                             flags,
> +                             "",
> +                             argv, argvlen, argv_copy,
> +                             envp, envplen, envp_copy,
> +                             dtable, dtablesize,
> +                             dtable_copy,
> +                             portarray, nports,
> +                             portarray_copy,
> +                             intarray, nints,
> +                             intarray_copy,
> +                             deallocnames, ndeallocnames,
> +                             destroynames, ndestroynames);
> +}
> +
> +kern_return_t
> +S_exec_exec_file_name (struct trivfs_protid *protid,
> +                    file_t file,
> +                    task_t oldtask,
> +                    int flags,
> +                    char *filename,
> +                    char *argv, mach_msg_type_number_t argvlen, boolean_t 
> argv_copy,
> +                    char *envp, mach_msg_type_number_t envplen, boolean_t 
> envp_copy,

Break these two lines.  Try to stick to less than 76 columns or less than
80 if the reformatting changes lines that would otherwise be unaffected.

> +                    mach_port_t *dtable, mach_msg_type_number_t dtablesize,
> +                    boolean_t dtable_copy,
> +                    mach_port_t *portarray, mach_msg_type_number_t nports,
> +                    boolean_t portarray_copy,
> +                    int *intarray, mach_msg_type_number_t nints,
> +                    boolean_t intarray_copy,
> +                    mach_port_t *deallocnames, mach_msg_type_number_t 
> ndeallocnames,
> +                    mach_port_t *destroynames, mach_msg_type_number_t 
> ndestroynames)

Break these two lines.

> diff --git a/exec/hashexec.c b/exec/hashexec.c
> index 2aa3844..6be8dfe 100644
> --- a/exec/hashexec.c
> +++ b/exec/hashexec.c
> @@ -1,5 +1,5 @@
>  /* GNU Hurd standard exec server, #! script execution support.
> -   Copyright (C) 1995,96,97,98,99,2000,02 Free Software Foundation, Inc.
> +   Copyright (C) 1995,96,97,98,99,2000,02,10 Free Software Foundation, Inc.
>     Written by Roland McGrath.

Reformat copyright years.

> @@ -225,7 +226,8 @@ check_hashbang (struct execdata *e,
>           file_name = NULL;
>         else if (! (flags & EXEC_SECURE))
>           {
> -           /* Try to figure out the file's name.  We guess that if ARGV[0]
> +           /* Try to figure out the file's name.  If FILE_NAME_EXEC is not 
> NULL,
> +              then it's the file's name.  Otherwise we guess that if ARGV[0]
>                contains a slash, it might be the name of the file; and that
>                if it contains no slash, looking for files named by ARGV[0] in
>                the `PATH' environment variable might find it.  */

I think its time to reformat this paragraph.

> @@ -278,7 +280,9 @@ check_hashbang (struct execdata *e,
>             else
>               name = argv;
>  
> -           if (strchr (name, '/') != NULL)
> +           if (file_name_exec && strcmp (file_name_exec, ""))
> +             error = lookup (name = file_name_exec, 0, &name_file);
> +           else if (strchr (name, '/') != NULL)
>               error = lookup (name, 0, &name_file);
>             else if ((error = hurd_catch_signal
>                       (sigmask (SIGBUS) | sigmask (SIGSEGV),

Do file_name_exec[0] != '\0' instead as other Hurd code does.

> diff --git a/exec/priv.h b/exec/priv.h
> index 7cee15e..92b7263 100644
> --- a/exec/priv.h
> +++ b/exec/priv.h
> @@ -1,5 +1,5 @@
>  /* GNU Hurd standard exec server, private declarations.
> -   Copyright (C) 1992,93,94,95,96,99,2000,02, 04 Free Software Foundation, 
> Inc.
> +   Copyright (C) 1992,93,94,95,96,99,2000,02,04,10 Free Software Foundation, 
> Inc.
>     Written by Roland McGrath.
>  
>  This file is part of the GNU Hurd.

Reformat.

> diff --git a/hurd/exec.defs b/hurd/exec.defs
> index 2888fb1..d8a242a 100644
> --- a/hurd/exec.defs
> +++ b/hurd/exec.defs
> @@ -1,5 +1,5 @@
>  /* Interface definitions for the exec servers.
> -   Copyright (C) 1991,92,93,94,95,2001 Free Software Foundation, Inc.
> +   Copyright (C) 1991,92,93,94,95,2001,10 Free Software Foundation, Inc.
>  
>  This file is part of the GNU Hurd.
>  

Reformat.

> @@ -29,6 +29,7 @@ EXEC_IMPORTS
>  
>  INTR_INTERFACE
>  
> +/* Deprecated: Use exec_exec_file_name instead.  */
>  routine exec_exec (
>       execserver: file_t;
>       file: mach_port_send_t;

No uppercase after colon.  :-)

Regards,
  Fredrik



reply via email to

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