It is good to know the string that was received, or the reason why nothing was
received.
ret = 1;
out:
if (ret < 0) {
- PARA_NOTICE_LOG("n = %d, did not receive pattern '%s'\n", n,
- pattern);
+ PARA_NOTICE_LOG("did not receive pattern '%s'\n", pattern);
if (n > 0)
- PARA_NOTICE_LOG("recvd: %s\n", buf);
+ PARA_NOTICE_LOG("recvd %d bytes: %s\n", n, buf);
+ else if (n < 0)
+ PARA_NOTICE_LOG("%s\n", para_strerror(-n));
}
free(buf);
return ret;