From 0131f68285df75323d574d950d60c706b6e90cb5 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 4 Feb 2012 18:18:37 +0100 Subject: [PATCH] nonblocking-pipe tests: Fix a NULL program name in a diagnostic. * tests/test-nonblocking-pipe-main.c: Include progname.h. (main): Invoke set_program_name. * modules/nonblocking-pipe-tests (Depends-on): Add progname. --- ChangeLog | 7 +++++++ modules/nonblocking-pipe-tests | 1 + tests/test-nonblocking-pipe-main.c | 10 ++++++++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index cbd86372d..714e6c005 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2012-02-04 Bruno Haible + + nonblocking-pipe tests: Fix a NULL program name in a diagnostic. + * tests/test-nonblocking-pipe-main.c: Include progname.h. + (main): Invoke set_program_name. + * modules/nonblocking-pipe-tests (Depends-on): Add progname. + 2012-02-04 Eric Blake canonicalize-lgpl: fix // handling diff --git a/modules/nonblocking-pipe-tests b/modules/nonblocking-pipe-tests index fa3b771f7..eccf839b6 100644 --- a/modules/nonblocking-pipe-tests +++ b/modules/nonblocking-pipe-tests @@ -13,6 +13,7 @@ stdbool unistd nonblocking wait-process +progname pipe-posix dup2 environ diff --git a/tests/test-nonblocking-pipe-main.c b/tests/test-nonblocking-pipe-main.c index c5c15cf55..966293524 100644 --- a/tests/test-nonblocking-pipe-main.c +++ b/tests/test-nonblocking-pipe-main.c @@ -32,6 +32,7 @@ #include "nonblocking.h" #include "wait-process.h" +#include "progname.h" #include "macros.h" #include "test-nonblocking-pipe.h" @@ -41,12 +42,17 @@ int main (int argc, char *argv[]) { - const char *child_path = argv[1]; - int test = atoi (argv[2]); + const char *child_path; + int test; int fd[2]; int child; int exitcode; + set_program_name (argv[0]); + + child_path = argv[1]; + test = atoi (argv[2]); + /* Create a pipe. */ ASSERT (pipe (fd) >= 0); -- 2.11.0