[lxc-devel] [lxd/master] util_linux_cgo: restore old behavior

brauner on Github lxc-bot at linuxcontainers.org
Mon Feb 25 14:54:42 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 493 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190225/6082ee6e/attachment.bin>
-------------- next part --------------
From 844383f90ae1c7e69905f9c6e4d519da9a50cba8 Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Mon, 25 Feb 2019 15:53:11 +0100
Subject: [PATCH] util_linux_cgo: restore old behavior

lxc_abstract_unix_recv_fds() used to return 0 if recvmsg() returned 0
and ret if it return < 0. Let's restore that behavior.

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
 shared/util_linux_cgo.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/shared/util_linux_cgo.go b/shared/util_linux_cgo.go
index 47a9d5e2dd..f4dc152519 100644
--- a/shared/util_linux_cgo.go
+++ b/shared/util_linux_cgo.go
@@ -215,7 +215,7 @@ int lxc_abstract_unix_recv_fds(int fd, int *recvfds, int num_recvfds,
 	ret = recvmsg(fd, &msg, 0);
 	if (ret <= 0) {
 		fprintf(stderr, "%s - Failed to receive file descriptor\n", strerror(errno));
-		return -1;
+		return ret;
 	}
 
 	cmsg = CMSG_FIRSTHDR(&msg);


More information about the lxc-devel mailing list