[sheepdog] [PATCH] sheep: fixed compile warning

Kai Zhang kyle at zelin.io
Mon Jun 3 14:29:16 CEST 2013


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

Signed-off-by: Kai Zhang <kyle at zelin.io>
---
 sheep/migrate.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sheep/migrate.c b/sheep/migrate.c
index ad3903a..b29c7e1 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.1




More information about the sheepdog mailing list