[CRIU] [PATCH 3/5] files-reg: Use close_safe for fd variable

Cyrill Gorcunov gorcunov at openvz.org
Sat Jul 28 08:13:31 EDT 2012


This makes compiler happy.

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

diff --git a/files-reg.c b/files-reg.c
index e6e1c2d..54bfb9e 100644
--- a/files-reg.c
+++ b/files-reg.c
@@ -183,7 +183,7 @@ tail:
 
 static int dump_ghost_file(int _fd, u32 id, const struct stat *st)
 {
-	int img, fd;
+	int img, fd = -1;
 	GhostFileEntry gfe = GHOST_FILE_ENTRY__INIT;
 	char lpath[32];
 
@@ -215,7 +215,7 @@ static int dump_ghost_file(int _fd, u32 id, const struct stat *st)
 			return -1;
 	}
 
-	close(fd);
+	close_safe(&fd);
 	close(img);
 	return 0;
 }
-- 
1.7.7.6



More information about the CRIU mailing list