[CRIU] [PATCH] files: Add case::default in open_fd

Cyrill Gorcunov gorcunov at openvz.org
Thu Mar 29 13:47:42 EDT 2012


Otherwise I'm getting error
 |
 | files.c: In function ‘prepare_fds’:
 | files.c:329:23: error: ‘tmp’ may be used uninitialized in this function [-Werror=uninitialized]
 | files.c:309:6: note: ‘tmp’ was declared here

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

diff --git a/files.c b/files.c
index 0fe0e03..a9047d1 100644
--- a/files.c
+++ b/files.c
@@ -321,6 +321,9 @@ static int open_fd(int pid, struct fdinfo_entry *fe,
 	case FDINFO_INETSK:
 		tmp = open_inet_sk(fe);
 		break;
+	default:
+		tmp = -1;
+		break;
 	}
 
 	if (tmp < 0)
-- 
1.7.7.6



More information about the CRIU mailing list