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:
Horst Schirmeier
2014-06-30 12:18:14 +02:00
parent 960f0881a2
commit 9d5737a37d

View File

@ -19,7 +19,7 @@ JobClient::JobClient(const std::string& server, int port)
cout << "JobServer: " << m_server.c_str() << endl;
if (m_server_ent == NULL) {
perror("[Client@gethostbyname()]");
herror("[Client@gethostbyname()]");
// TODO: Log-level?
exit(1);
}