Changed gethostbyname
This commit is contained in:
parent
6f0fbc34e4
commit
05577b9a8b
@ -125,12 +125,15 @@ int opentcp(char *name)
|
|||||||
case HOST_NOT_FOUND: errmsg = (char *)"Authoritative: Host not found"; break;
|
case HOST_NOT_FOUND: errmsg = (char *)"Authoritative: Host not found"; break;
|
||||||
case TRY_AGAIN: errmsg = (char *)"Non-Authoritive: Host not found"; break;
|
case TRY_AGAIN: errmsg = (char *)"Non-Authoritive: Host not found"; break;
|
||||||
case NO_RECOVERY: errmsg = (char *)"Non recoverable errors"; break;
|
case NO_RECOVERY: errmsg = (char *)"Non recoverable errors"; break;
|
||||||
|
case NO_ADDRESS: errmsg = (char *)"Host has no IP address"; break;
|
||||||
default: errmsg = (char *)"Unknown error"; break;
|
default: errmsg = (char *)"Unknown error"; break;
|
||||||
}
|
}
|
||||||
Syslog('+', "No IP address for %s: %s\n", name, errmsg);
|
Syslog('+', "No IP address for %s: %s\n", name, errmsg);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Syslog('-', "1");
|
||||||
|
|
||||||
signal(SIGPIPE, sigpipe);
|
signal(SIGPIPE, sigpipe);
|
||||||
signal(SIGHUP, linedrop);
|
signal(SIGHUP, linedrop);
|
||||||
|
|
||||||
@ -141,6 +144,7 @@ int opentcp(char *name)
|
|||||||
close(0);
|
close(0);
|
||||||
close(1);
|
close(1);
|
||||||
|
|
||||||
|
Syslog('-', "2");
|
||||||
if ((fd = socket(AF_INET,SOCK_STREAM,0)) != 0) {
|
if ((fd = socket(AF_INET,SOCK_STREAM,0)) != 0) {
|
||||||
WriteError("$Cannot create socket (got %d, expected 0)", fd);
|
WriteError("$Cannot create socket (got %d, expected 0)", fd);
|
||||||
open("/dev/null",O_RDONLY);
|
open("/dev/null",O_RDONLY);
|
||||||
|
Reference in New Issue
Block a user