From f951ce95f2901cc04b77f9a0424b53a8583144d4 Mon Sep 17 00:00:00 2001 From: Matteo Cypriani Date: Sat, 23 Jul 2011 23:00:42 +0200 Subject: [PATCH] [Aggregator] Use perror() after recvfrom() Use perror() instead of fprintf() after the recvfrom() calls. Fix the test in listen_for_aps(). --- owlps-aggregator/owlps-aggregatord.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/owlps-aggregator/owlps-aggregatord.c b/owlps-aggregator/owlps-aggregatord.c index e4f7276..24caef8 100644 --- a/owlps-aggregator/owlps-aggregatord.c +++ b/owlps-aggregator/owlps-aggregatord.c @@ -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 ; }