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

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

index 714e6c0..2449e00 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2012-02-04  Bruno Haible  <bruno@clisp.org>
 
+       nonblocking-socket tests: Fix a NULL program name in a diagnostic.
+       * tests/test-nonblocking-socket-main.c: Include progname.h.
+       (main): Invoke set_program_name.
+       * modules/nonblocking-socket-tests (Depends-on): Add progname.
+
        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.
index 2eb883e..9c3a614 100644 (file)
@@ -16,6 +16,7 @@ unistd
 sys_socket
 nonblocking
 wait-process
+progname
 environ
 posix_spawnp
 netinet_in
index 72b9f87..42e0c9c 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "nonblocking.h"
 #include "wait-process.h"
+#include "progname.h"
 
 #include "macros.h"
 #include "socket-server.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 server;
   int port;
   int child;
   int server_socket;
   int exitcode;
 
+  set_program_name (argv[0]);
+
+  child_path = argv[1];
+  test = atoi (argv[2]);
+
   /* Create a server socket.  */
   server = create_server (0, 1, &port);