[v5,0/3] posix: Execute file function fixes

Message ID 56DDB41E.1000701@linaro.org
State New
Headers show

Commit Message

Adhemerval Zanella March 7, 2016, 5:02 p.m.
On 07-03-2016 23:10, Adhemerval Zanella wrote:
> 

> 

> On 07-03-2016 22:50, H.J. Lu wrote:

>> On Mon, Mar 7, 2016 at 7:37 AM, Adhemerval Zanella

>> <adhemerval.zanella@linaro.org> wrote:

>>>

>>>

>>> On 07-03-2016 21:46, H.J. Lu wrote:

>>>> On Wed, Mar 2, 2016 at 10:47 AM, Adhemerval Zanella

>>>> <adhemerval.zanella@linaro.org> wrote:

>>>>> I believe with latest comments from Paul Eggert I see these patchset is ok

>>>>> for master.  So I would like to commit it shortly if no one opposes it.

>>>>>

>>>>

>>>> On x86-64, I got

>>>>

>>>> FAIL: posix/tst-execvpe5

>>>>

>>>> # cat  posix/tst-execvpe5.out

>>>> Wrong number of arguments (4)

>>>>

>>>

>>> Could you paste the result of strace -f with test running in your environment?

>>> I am trying to reproduce it, but without much success. Also the buildbot is

>>> not showing the issue.

>>

>> Please configure glibc with

>>

>> --enable-hardcoded-path-in-tests

>>

> 

> Right, the testcase does not handle this scenario. I will fix it.

> 


This fixes the issue on tst-execvpe5 with --enable-hardcoded-path-in-tests:


I will commit this tomorrow (since I on UTC+7).

Patch

diff --git a/posix/tst-execvpe5.c b/posix/tst-execvpe5.c
index ffd764a..3473330 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);
        }