[sheepdog] [PATCH stable-0.6 2/2] sheep: fixed compile warning

Hitoshi Mitake mitake.hitoshi at lab.ntt.co.jp
Mon Sep 2 04:04:18 CEST 2013


From: Kai Zhang <kyle at zelin.io>

fixed compile warning:
migrate.c:125: warning: ‘ret’ may be used uninitialized in this function

Signed-off-by: Kai Zhang <kyle at zelin.io>
Signed-off-by: Liu Yuan <namei.unix at gmail.com>
---
 sheep/migrate.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sheep/migrate.c b/sheep/migrate.c
index 9cc963f..33cb2cf 100644
--- a/sheep/migrate.c
+++ b/sheep/migrate.c
@@ -122,7 +122,7 @@ static void for_each_epoch(int (*func)(uint32_t epoch))
 static int backup_file(char *fname, char *suffix)
 {
 	char dst_file[PATH_MAX];
-	int fd = -1, ret, len;
+	int fd = -1, ret = -1, len;
 	void *buf = NULL;
 
 	snprintf(dst_file, sizeof(dst_file), "%s.%s", fname, suffix);
-- 
1.7.10.4




More information about the sheepdog mailing list