jobclient: fix error reporting
gethostbyname() doesn't set errno but h_errno. Thus, we need to call herror() instead of perror() to print an appropriate error message. (Thanks, Björn.) Change-Id: I8fd4bdd4af41774dd290151c5ad37090d006f423
This commit is contained in:
@ -19,7 +19,7 @@ JobClient::JobClient(const std::string& server, int port)
|
|||||||
cout << "JobServer: " << m_server.c_str() << endl;
|
cout << "JobServer: " << m_server.c_str() << endl;
|
||||||
|
|
||||||
if (m_server_ent == NULL) {
|
if (m_server_ent == NULL) {
|
||||||
perror("[Client@gethostbyname()]");
|
herror("[Client@gethostbyname()]");
|
||||||
// TODO: Log-level?
|
// TODO: Log-level?
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user