This patch gets rid of the below message while performing a code analysis with cppcheck.
[sheep/migrate.c:117] -> [sheep/migrate.c:122]: (performance) Variable 'fd' is reassigned a value before the old one has been used. Signed-off-by: Ruoyu <[email protected]> --- sheep/migrate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sheep/migrate.c b/sheep/migrate.c index 81c4de7..f01eaf6 100644 --- a/sheep/migrate.c +++ b/sheep/migrate.c @@ -114,7 +114,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 = -1, len; + int fd, ret = -1, len; void *buf = NULL; snprintf(dst_file, sizeof(dst_file), "%s.%s", fname, suffix); -- 1.8.3.2 -- sheepdog mailing list [email protected] http://lists.wpkg.org/mailman/listinfo/sheepdog
