From 885eaad72962aece59ff05c30bb42d3bfe80db53 Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Mon, 13 May 2013 15:29:29 +0200 Subject: [PATCH] Removed goto from code. --- src/csync_statedb.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/csync_statedb.c b/src/csync_statedb.c index 16e2a79f7..2a706fd41 100644 --- a/src/csync_statedb.c +++ b/src/csync_statedb.c @@ -246,20 +246,22 @@ out: } int csync_statedb_write(CSYNC *ctx) { + bool recreate_db = false; /* drop tables */ if (csync_statedb_drop_tables(ctx) < 0) { - goto retry_create; + recreate_db = true; } /* create tables */ - if (csync_statedb_create_tables(ctx) < 0) { - goto retry_create; + if (! recreate_db) { + if (csync_statedb_create_tables(ctx) < 0) { + recreate_db = true; + } } - if (0) { + if (recreate_db) { char *statedb_tmp; int rc; -retry_create: if (asprintf(&statedb_tmp, "%s.ctmp", ctx->statedb.file) < 0) { return -1; }