[uClinux-dev] [PATCH] haserl: fork and legacy index

Greg Ungerer gerg at snapgear.com
Wed May 28 22:02:14 EDT 2008


Hi Thomas,

Thomas Chou wrote:
> The exec permission of configure file was missing. The fork() is changed 
> to vfork() and legacy index() is changed to strchr().
> 
> Signed-off-by: Thomas Chou <thomas at wytron.com.tw>

Applied.

Thanks
Greg



>  user/haserl/src/h_bash.c  |    4 ++++
>  user/haserl/src/haserl.c  |    2 +-
>  user/haserl/src/rfc2388.c |    4 ++++
>  3 files changed, 9 insertions(+), 1 deletions(-)
>  mode change 100644 => 100755 user/haserl/configure
> 
> diff --git a/user/haserl/configure b/user/haserl/configure
> old mode 100644
> new mode 100755
> diff --git a/user/haserl/src/h_bash.c b/user/haserl/src/h_bash.c
> index 063a2c5..8100c33 100644
> --- a/user/haserl/src/h_bash.c
> +++ b/user/haserl/src/h_bash.c
> @@ -63,7 +63,11 @@ bash_setup (char *shell, list_t * env)
>    retcode = pipe (&subshell_pipe[PARENT_IN]);
>    if (retcode == 0)
>      {
> +#ifdef EMBED
> +      subshell_pid = vfork ();
> +#else
>        subshell_pid = fork ();
> +#endif
>        if (subshell_pid == -1)
>  	{
>  	  die_with_message (NULL, NULL, g_err_msg[E_SUBSHELL_FAIL]);
> diff --git a/user/haserl/src/haserl.c b/user/haserl/src/haserl.c
> index 3c342d1..3e9d5c0 100644
> --- a/user/haserl/src/haserl.c
> +++ b/user/haserl/src/haserl.c
> @@ -210,7 +210,7 @@ myputenv (list_t * cur, char *str, char *prefix)
>      }
>    memcpy ((char *) (entry + strlen (prefix)), str, strlen (str));
>  
> -  keylen = (size_t) (index (entry, '=') - entry);
> +  keylen = (size_t) (strchr (entry, '=') - entry);
>  
>    if (keylen <= 0)
>      {
> diff --git a/user/haserl/src/rfc2388.c b/user/haserl/src/rfc2388.c
> index 8fd626d..476c805 100644
> --- a/user/haserl/src/rfc2388.c
> +++ b/user/haserl/src/rfc2388.c
> @@ -189,7 +189,11 @@ mime_exec (mime_var_t * obj, char *fifo)
>    char *c;
>    int fh;
>  
> +#ifdef EMBED
> +  pid = vfork ();
> +#else
>    pid = fork ();
> +#endif
>    if (pid == -1)
>      {
>        empty_stdin ();

-- 
------------------------------------------------------------------------
Greg Ungerer  --  Chief Software Dude       EMAIL:     gerg at snapgear.com
Secure Computing Corporation                PHONE:       +61 7 3435 2888
825 Stanley St,                             FAX:         +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia         WEB: http://www.SnapGear.com



More information about the uClinux-dev mailing list