Use the executable itself for input by default.
* tests/sendfile.c (main): Use av[0] instead of av[1] for input.
* tests/sendfile64.c (main): Likewise.
* tests/sendfile.test: Invoke run_prog without arguments.
* tests/sendfile64.test: Likewise.
int
main(int ac, const char **av)
{
- assert(ac == 2);
+ assert(ac == 1);
(void) close(0);
if (open("/dev/zero", O_RDONLY) != 0)
if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv))
perror_msg_and_skip("socketpair");
- int reg_in = open(av[1], O_RDONLY);
+ int reg_in = open(av[0], O_RDONLY);
if (reg_in < 0)
- perror_msg_and_fail("open: %s", av[1]);
+ perror_msg_and_fail("open: %s", av[0]);
struct stat stb;
assert(fstat(reg_in, &stb) == 0);
. "${srcdir=.}/init.sh"
-exe="./${ME_%.test}"
-run_prog "$exe" "$exe" > /dev/null
+run_prog > /dev/null
OUT="$LOG.out"
run_strace -a24 -esendfile $args > "$OUT"
match_diff "$LOG" "$OUT"
int
main(int ac, const char **av)
{
- assert(ac == 2);
+ assert(ac == 1);
(void) close(0);
if (open("/dev/zero", O_RDONLY) != 0)
if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv))
perror_msg_and_skip("socketpair");
- int reg_in = open(av[1], O_RDONLY);
+ int reg_in = open(av[0], O_RDONLY);
if (reg_in < 0)
- perror_msg_and_fail("open: %s", av[1]);
+ perror_msg_and_fail("open: %s", av[0]);
struct stat stb;
assert(fstat(reg_in, &stb) == 0);
. "${srcdir=.}/init.sh"
-exe="./${ME_%.test}"
-run_prog "$exe" "$exe" > /dev/null
+run_prog > /dev/null
OUT="$LOG.out"
run_strace -a24 -esendfile64 $args > "$OUT"
match_diff "$LOG" "$OUT"