All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xiao Yang <yangx.jy@cn.fujitsu.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2] newlib_tests/test_exec.c: Fix compiler error before glibc v2.11
Date: Tue, 4 Sep 2018 14:37:47 +0800	[thread overview]
Message-ID: <5B8E283B.2080707@cn.fujitsu.com> (raw)
In-Reply-To: <1535328355-16759-1-git-send-email-yangx.jy@cn.fujitsu.com>

Hi,

Could you help me push the v2 patch? Thanks a lot.  :-) 

Thanks,
Xiao Yang

On 2018/08/27 8:05, Xiao Yang wrote:

> Before glibc v2.11, execvpe() was not introduced and resulted in
> compiler error, so we replace execvpe() with execve() and update
> test-writing-guidelines.txt.
>
> Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
> ---
>  doc/test-writing-guidelines.txt | 8 ++++++--
>  lib/newlib_tests/test_exec.c    | 8 ++++++--
>  2 files changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/doc/test-writing-guidelines.txt b/doc/test-writing-guidelines.txt
> index a169724..0b89cf9 100644
> --- a/doc/test-writing-guidelines.txt
> +++ b/doc/test-writing-guidelines.txt
> @@ -697,14 +697,18 @@ a non zero exit code.
>  -------------------------------------------------------------------------------
>  /* test.c */
>  #define _GNU_SOURCE
> -#include <stdlib.h>
> +#include <unistd.h>
>  #include "tst_test.h"
>  
>  static void do_test(void)
>  {
>  	char *const argv[] = {"test_exec_child", NULL};
> +	char path[4096];
>  
> -	execvpe(argv[0], argv, environ);
> +	if (tst_get_path("test_exec_child", path, sizeof(path)))
> +		tst_brk(TCONF, "Couldn't find test_exec_child in $PATH");
> +
> +	execve(path, argv, environ);
>  
>  	tst_res(TBROK | TERRNO, "EXEC!");
>  }
> diff --git a/lib/newlib_tests/test_exec.c b/lib/newlib_tests/test_exec.c
> index 8aef621..2c86568 100644
> --- a/lib/newlib_tests/test_exec.c
> +++ b/lib/newlib_tests/test_exec.c
> @@ -25,14 +25,18 @@
>   */
>  
>  #define _GNU_SOURCE
> -#include <stdlib.h>
> +#include <unistd.h>
>  #include "tst_test.h"
>  
>  static void do_test(void)
>  {
>  	char *const argv[] = {"test_exec_child", NULL};
> +	char path[4096];
>  
> -	execvpe(argv[0], argv, environ);
> +	if (tst_get_path("test_exec_child", path, sizeof(path)))
> +		tst_brk(TCONF, "Couldn't find test_exec_child in $PATH");
> +
> +	execve(path, argv, environ);
>  
>  	tst_res(TBROK | TERRNO, "EXEC!");
>  }




  parent reply	other threads:[~2018-09-04  6:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-23  9:06 [LTP] [PATCH] newlib_tests/test_exec.c: Fix compiler error before glibc v2.11 Xiao Yang
2018-08-23  9:18 ` Xiao Yang
2018-08-24 14:56 ` Cyril Hrubis
2018-08-26 23:51   ` Xiao Yang
2018-08-27  0:05   ` [LTP] [PATCH v2] " Xiao Yang
2018-08-28 11:38     ` Jan Stancek
2018-08-28 23:54       ` Xiao Yang
2018-08-31 12:10     ` Petr Vorel
2018-09-04  6:37     ` Xiao Yang [this message]
2018-09-10 22:41     ` Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5B8E283B.2080707@cn.fujitsu.com \
    --to=yangx.jy@cn.fujitsu.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.