fix building on Solaris

- a feature test macro is needed to get msg_control in struct msghdr
- variables must not be named sun to avoid conflict with a macro
- res_init() needs -lresolv
- configure tests for IPv6 and getaddrinfo need -lsocket -lnsl
- pid_t is defined as long and needs to be cast for %d format
This commit is contained in:
Miroslav Lichvar
2015-09-18 10:10:50 +02:00
parent 046f219a0e
commit f444561a10
3 changed files with 16 additions and 12 deletions

2
main.c
View File

@@ -265,7 +265,7 @@ write_lockfile(void)
if (!out) {
LOG_FATAL(LOGF_Main, "could not open lockfile %s for writing", pidfile);
} else {
fprintf(out, "%d\n", getpid());
fprintf(out, "%d\n", (int)getpid());
fclose(out);
}
}