]> Savannah Git Hosting - gnulib.git/commitdiff
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 714e6c00518d3d108610ee4d4457a8a30ba0017e..2449e0093ac75c93fdf8595b10778c294a50249d 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 2eb883ed334e1271cb50e596a080f5d9f2fff109..9c3a614f72d50c9a4091ef394f86ce60aedcabb0 100644 (file)
@@ -16,6 +16,7 @@ unistd
 sys_socket
 nonblocking
 wait-process
+progname
 environ
 posix_spawnp
 netinet_in
index 72b9f872191b0b9b58e924897020101a88177504..42e0c9c98af4ec1118e83a304a542c6b3532955c 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);