summary refs log tree commit diff
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.com>2016-03-08 09:30:38 +0700
committerAdhemerval Zanella <adhemerval.zanella@linaro.com>2016-03-08 09:30:38 +0700
commite49b221aeaf184cff0b75da56b41be807b5a5403 (patch)
tree6c4d652b8c7dfe47bc456710a5ddbcca8606d58c
parentcc4084017e211cdeafef2d9036a130cbd6f2cadd (diff)
downloadglibc-e49b221aeaf184cff0b75da56b41be807b5a5403.tar.gz
glibc-e49b221aeaf184cff0b75da56b41be807b5a5403.tar.xz
glibc-e49b221aeaf184cff0b75da56b41be807b5a5403.zip
posix: Fix tst-execvpe5 for --enable-hardcoded-path-in-tests
This patch fixes the posix/tst-execvpe5 invocation when GLIBC is
configured with --enable-hardcoded-path-in-tests which fails with:

$ cat  posix/tst-execvpe5.out
Wrong number of arguments (4)

Checked on x86-64 and powerpc64le.

	* posix/tst-execvpe5.c (do_test): Fix fix test invocation when
	configured with --enable-hardcoded-path-in-tests.
-rw-r--r--ChangeLog5
-rw-r--r--posix/tst-execvpe5.c7
2 files changed, 10 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 3cb82bc115..0fb4ebdfb4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-03-07  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+
+	* posix/tst-execvpe5.c (do_test): Fix fix test invocation when
+	configured with --enable-hardcoded-path-in-tests.
+
 2016-03-08  Joseph Myers  <joseph@codesourcery.com>
 
 	[BZ #19677]
diff --git a/posix/tst-execvpe5.c b/posix/tst-execvpe5.c
index ffd764a639..34733301f3 100644
--- a/posix/tst-execvpe5.c
+++ b/posix/tst-execvpe5.c
@@ -88,13 +88,16 @@ do_test (int argc, char *argv[])
        + "--library-path"	optional
        + the library path	optional
        + the application name
+
+    if --enable-hardcoded-path-in-tests is used, just
+      + the application name
   */
 
   if (restart)
     {
       if (argc != 1)
 	{
-	  printf ("Wrong number of arguments (%d)\n", argc);
+	  printf ("Wrong number of arguments (%d) in restart\n", argc);
 	  exit (EXIT_FAILURE);
 	}
 
@@ -125,7 +128,7 @@ do_test (int argc, char *argv[])
 	}
       else
 	{
-	  char *args[] = { argv[1], argv[1],
+	  char *args[] = { argv[0],
 			   (char *) "--direct", (char *) "--restart", NULL };
 	  execvpe (args[0], args, envs);
 	}