[CRIU] [PATCH cr 1/2] sk-queue: recvmsg saves a error code in errno

Andrey Vagin avagin at openvz.org
Thu Sep 27 14:37:12 EDT 2012


Probably sys_recvmsg was used earlier, which returns a error code.

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 sk-queue.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sk-queue.c b/sk-queue.c
index 436becf..9f872bb 100644
--- a/sk-queue.c
+++ b/sk-queue.c
@@ -127,9 +127,9 @@ int dump_sk_queue(int sock_fd, int sock_id)
 
 		ret = pe.length = recvmsg(sock_fd, &msg, MSG_DONTWAIT | MSG_PEEK);
 		if (ret < 0) {
-			if (ret == -EAGAIN)
+			if (errno == EAGAIN)
 				break; /* we're done */
-			pr_perror("sys_recvmsg fail: error\n");
+			pr_perror("recvmsg fail: error\n");
 			goto err_set_sock;
 		}
 		if (msg.msg_flags & MSG_TRUNC) {
-- 
1.7.1



More information about the CRIU mailing list