mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-09-06 18:07:41 +02:00
- Fix #545: improved logging, the ip address of the error is printed
on the same log-line as the error. git-svn-id: file:///svn/unbound/trunk@3112 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
@@ -200,15 +200,14 @@ contact_server(const char* svr, struct config_file* cfg, int statuscmd)
|
||||
#endif
|
||||
}
|
||||
if(connect(fd, (struct sockaddr*)&addr, addrlen) < 0) {
|
||||
log_addr(0, "address", &addr, addrlen);
|
||||
#ifndef USE_WINSOCK
|
||||
log_err("connect: %s", strerror(errno));
|
||||
log_err_addr("connect", strerror(errno), &addr, addrlen);
|
||||
if(errno == ECONNREFUSED && statuscmd) {
|
||||
printf("unbound is stopped\n");
|
||||
exit(3);
|
||||
}
|
||||
#else
|
||||
log_err("connect: %s", wsa_strerror(WSAGetLastError()));
|
||||
log_err_addr("connect", wsa_strerror(WSAGetLastError()), &addr, addrlen);
|
||||
if(WSAGetLastError() == WSAECONNREFUSED && statuscmd) {
|
||||
printf("unbound is stopped\n");
|
||||
exit(3);
|
||||
|
||||
Reference in New Issue
Block a user