tests: Fix headers inclusion
Bulding on musl standard library revealed two issues:
(1) A missing header file from server_cli.c:
x86_64-gentoo-linux-musl-gcc -DHAVE_CONFIG_H -I. -I../.. -I/usr/include/libxml2 -I../../src -DSRCDIR=\"../..\" -O2 -pipe -march=x86-64 -frecord-gcc-switches -fno-diagnostics-color -fmessage-length=0 -std=c99 -Wall -c server_cli.c
[...]
server_cli.c: In function 'main':
server_cli.c:91:28: warning: implicit declaration of function 'getopt' [-Wimplicit-function-declaration[https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-function-declaration]]
91 | while (-1 != (option = getopt(argc, argv, "h:p:t:u:a:s:S:c:"))) {
| ^~~~~~
server_cli.c:95:28: error: 'optarg' undeclared (first use in this function)
95 | otp_code = optarg;
| ^~~~~~
server_cli.c:95:28: note: each undeclared identifier is reported only once for each function it appears in
server_cli.c:125:9: error: 'optind' undeclared (first use in this function); did you mean 'option'?
125 | if (optind != argc) {
| ^~~~~~
| option
The compilation unit forgot to include <unistd.h>.
(2) Badly named <wait.h> in server.c:
x86_64-gentoo-linux-musl-gcc -DHAVE_CONFIG_H -I. -I../.. -I/usr/include/libxml2 -I../../src -DSRCDIR=\"../..\" -O2 -pipe -march=x86-64 -frecord-gcc-switches -fno-diagnostics-color -fmessage-length=0 -std=c99 -Wall -c server.c -fPIC -DPIC -o .libs/libserver_la-server.o
[...]
In file included from server.c:26:
/usr/include/wait.h:1:2: warning: #warning redirecting incorrect #include <wait.h> to <sys/wait.h> [-Wcpp[https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wcpp]]
1 | #warning redirecting incorrect #include <wait.h> to <sys/wait.h>
| ^~~~~~~
The compilation unit misnamed <sys/wait.h>.
This patch fixes both these issues.
https://bugs.gentoo.org/show_bug.cgi?id=836628