[CRIU] [PATCH 1/4] util-fd: print errors from send_fds

Andrey Vagin avagin at openvz.org
Mon Apr 7 03:00:12 PDT 2014


Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 pie/util-fd.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/pie/util-fd.c b/pie/util-fd.c
index 988c7fd..09d8ece 100644
--- a/pie/util-fd.c
+++ b/pie/util-fd.c
@@ -5,6 +5,7 @@
 #include <errno.h>
 
 #include "compiler.h"
+#include "log.h"
 #include "asm/string.h"
 #include "asm/types.h"
 
@@ -77,13 +78,18 @@ int send_fds(int sock, struct sockaddr_un *saddr, int len,
 				u32 v[2];
 
 				flags = __sys(fcntl)(fd, F_GETFD, 0);
-				if (flags < 0)
+				if (flags < 0) {
+					pr_err("fcntl(%d, F_GETFD) -> %d\n", fd, flags);
 					return -1;
+				}
 
 				p->flags = (char)flags;
 
-				if (__sys(fcntl)(fd, F_GETOWN_EX, (long)&owner_ex))
+				ret = __sys(fcntl)(fd, F_GETOWN_EX, (long)&owner_ex);
+				if (ret) {
+					pr_err("fcntl(%d, F_GETOWN_EX) -> %d\n", fd, ret);
 					return -1;
+				}
 
 				/*
 				 * Simple case -- nothing is changed.
@@ -93,8 +99,11 @@ int send_fds(int sock, struct sockaddr_un *saddr, int len,
 					continue;
 				}
 
-				if (__sys(fcntl)(fd, F_GETOWNER_UIDS, (long)&v))
+				ret = __sys(fcntl)(fd, F_GETOWNER_UIDS, (long)&v);
+				if (ret) {
+					pr_err("fcntl(%d, F_GETOWNER_UIDS) -> %d\n", fd, ret);
 					return -1;
+				}
 
 				p->fown.uid	 = v[0];
 				p->fown.euid	 = v[1];
-- 
1.8.5.3



More information about the CRIU mailing list