From 726b7b0f5cce9df5dd406a6a38a3e104fac9a070 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 26 Oct 2000 08:11:19 +0000 Subject: Update. 2000-10-26 Ulrich Drepper * posix/Makefile (tests): Add tst-chmod. (tst-chmod-ARGS): Define. * posix/tst-chmod.c: New file. * test-skeleton.c: Before calling user-defined function remove parameters from argument list. * posix/tst-exec.c: Adjust to this change. * posix/tst-spawn.c: Likewise. * sysdeps/unix/opendir.c (__opendir): Optimize a bit. Add __builtin_expect. --- posix/tst-exec.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'posix/tst-exec.c') diff --git a/posix/tst-exec.c b/posix/tst-exec.c index 0cb988d1de..2c541fcd04 100644 --- a/posix/tst-exec.c +++ b/posix/tst-exec.c @@ -126,24 +126,27 @@ do_test (int argc, char *argv[]) int status; /* We must have - - five parameters left of called initially - + -- + - four parameters left of called initially + path for ld.so + "--library-path" + the library path + the application name - - five parameters left if called through re-execution - + --direct - + --restart + - three parameters left if called through re-execution + file descriptor number which is supposed to be closed + the open file descriptor + the name of the closed desriptor */ - if (argc != 6) - error (EXIT_FAILURE, 0, "wrong number of arguments (%d)", argc); if (restart) - return handle_restart (argv[3], argv[4], argv[5]); + { + if (argc != 4) + error (EXIT_FAILURE, 0, "wrong number of arguments (%d)", argc); + + return handle_restart (argv[1], argv[2], argv[3]); + } + + if (argc != 5) + error (EXIT_FAILURE, 0, "wrong number of arguments (%d)", argc); /* Prepare the test. We are creating two files: one which file descriptor will be marked with FD_CLOEXEC, another which is not. */ @@ -182,7 +185,7 @@ do_test (int argc, char *argv[]) snprintf (fd2name, sizeof fd2name, "%d", fd2); /* This is the child. Construct the command line. */ - execl (argv[2], argv[2], argv[3], argv[4], argv[5], "--direct", + execl (argv[1], argv[1], argv[2], argv[3], argv[4], "--direct", "--restart", fd1name, fd2name, name1, NULL); error (EXIT_FAILURE, errno, "cannot exec"); -- cgit v1.2.3