Mercurial > hg > octave-lyh > gnulib-hg
changeset 16354:88ce25e2dffc
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.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sat, 04 Feb 2012 18:19:11 +0100 |
parents | 8b572983af73 |
children | cc8e7dd6c439 |
files | ChangeLog modules/nonblocking-socket-tests tests/test-nonblocking-socket-main.c |
diffstat | 3 files changed, 14 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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.
--- a/modules/nonblocking-socket-tests +++ b/modules/nonblocking-socket-tests @@ -16,6 +16,7 @@ sys_socket nonblocking wait-process +progname environ posix_spawnp netinet_in
--- a/tests/test-nonblocking-socket-main.c +++ b/tests/test-nonblocking-socket-main.c @@ -33,6 +33,7 @@ #include "nonblocking.h" #include "wait-process.h" +#include "progname.h" #include "macros.h" #include "socket-server.h" @@ -43,14 +44,19 @@ 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);