[Aggregator] Use perror() after recvfrom()
Use perror() instead of fprintf() after the recvfrom() calls. Fix the test in listen_for_aps().
This commit is contained in:
parent
0f54bd36a3
commit
f951ce95f2
|
@ -434,7 +434,7 @@ int read_loop(int sockfd)
|
|||
{
|
||||
if (owl_run)
|
||||
{
|
||||
fprintf(stderr, "No request received from client!\n") ;
|
||||
perror("No request received from listener") ;
|
||||
ret = ERR_NO_MESSAGE_RECEIVED ;
|
||||
}
|
||||
break ;
|
||||
|
@ -880,10 +880,10 @@ void* listen_for_aps(void *NULL_value)
|
|||
nread = recvfrom(listen_sockfd, &message, sizeof(message), 0,
|
||||
(struct sockaddr *) &client, &client_len) ;
|
||||
|
||||
if (nread <= 0 && owl_run)
|
||||
if (nread <= 0)
|
||||
{
|
||||
if (owl_run)
|
||||
fprintf(stderr, "No message received from listener!\n") ;
|
||||
perror("No message received from listener") ;
|
||||
continue ;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue