properly check for EAGAIN in recv() calls

If recv() has no more messages on a non-blocking socket, errno will be EAGAIN,
not the return value!
diff --git a/openbsc/src/ipaccess/ipaccess-proxy.c b/openbsc/src/ipaccess/ipaccess-proxy.c
index 61c3c5b..d018b6e 100644
--- a/openbsc/src/ipaccess/ipaccess-proxy.c
+++ b/openbsc/src/ipaccess/ipaccess-proxy.c
@@ -321,8 +321,8 @@
 	hh = (struct ipaccess_head *) msg->data;
 	ret = recv(bfd->fd, msg->data, msg->data_len, 0);
 	if (ret < 0) {
-		if (ret != -EAGAIN)
-			DEBUGP(DINP, "recv error  %s\n", strerror(errno));
+		if (errno != EAGAIN)
+			LOGP(DINP, LOGL_ERROR, "recv error  %s\n", strerror(errno));
 		msgb_free(msg);
 		return ret;
 	}
@@ -635,7 +635,7 @@
 	hh = (struct ipaccess_head *) msg->data;
 	ret = recv(bfd->fd, msg->data, 3, 0);
 	if (ret < 0) {
-		if (ret != -EAGAIN)
+		if (errno != EAGAIN)
 			LOGP(DINP, LOGL_ERROR, "recv error: %s\n", strerror(errno));
 		msgb_free(msg);
 		*error = ret;