[CRIU] [PATCH] parasite: Initialize fd in parasite_get_proc_fd

Cyrill Gorcunov gorcunov at openvz.org
Tue Sep 11 10:48:38 EDT 2012


Otherwise I get

 | parasite.c: In function ‘parasite_service’:
 | parasite.c:383:11: error: ‘fd’ may be used uninitialized in this function [-Werror=uninitialized]
 | cc1: all warnings being treated as errors

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 parasite.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/parasite.c b/parasite.c
index 1885812..8c5a4d5 100644
--- a/parasite.c
+++ b/parasite.c
@@ -380,7 +380,7 @@ static int init(struct parasite_init_args *args)
 static char proc_mountpoint[] = "proc.crtools";
 static int parasite_get_proc_fd()
 {
-	int ret, fd;
+	int ret, fd = -1;
 	char buf[2];
 
 	ret = sys_readlink("/proc/self", buf, sizeof(buf));
-- 
1.7.7.6



More information about the CRIU mailing list