nonblocking-pipe tests: Fix a NULL program name in a diagnostic.
authorBruno Haible <bruno@clisp.org>
Sat, 4 Feb 2012 17:18:37 +0000 (18:18 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 4 Feb 2012 17:20:42 +0000 (18:20 +0100)
* tests/test-nonblocking-pipe-main.c: Include progname.h.
(main): Invoke set_program_name.
* modules/nonblocking-pipe-tests (Depends-on): Add progname.

ChangeLog
modules/nonblocking-pipe-tests
tests/test-nonblocking-pipe-main.c

index cbd8637..714e6c0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-02-04  Bruno Haible  <bruno@clisp.org>
+
+       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  <eblake@redhat.com>
 
        canonicalize-lgpl: fix // handling
index fa3b771..eccf839 100644 (file)
@@ -13,6 +13,7 @@ stdbool
 unistd
 nonblocking
 wait-process
+progname
 pipe-posix
 dup2
 environ
index c5c15cf..9662935 100644 (file)
@@ -32,6 +32,7 @@
 
 #include "nonblocking.h"
 #include "wait-process.h"
+#include "progname.h"
 
 #include "macros.h"
 #include "test-nonblocking-pipe.h"
 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);