mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-27 06:45:49 +03:00
Removed goto from code.
This commit is contained in:
parent
cb0e06e7f8
commit
885eaad729
1 changed files with 7 additions and 5 deletions
|
@ -246,20 +246,22 @@ out:
|
||||||
}
|
}
|
||||||
|
|
||||||
int csync_statedb_write(CSYNC *ctx) {
|
int csync_statedb_write(CSYNC *ctx) {
|
||||||
|
bool recreate_db = false;
|
||||||
/* drop tables */
|
/* drop tables */
|
||||||
if (csync_statedb_drop_tables(ctx) < 0) {
|
if (csync_statedb_drop_tables(ctx) < 0) {
|
||||||
goto retry_create;
|
recreate_db = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* create tables */
|
/* create tables */
|
||||||
if (csync_statedb_create_tables(ctx) < 0) {
|
if (! recreate_db) {
|
||||||
goto retry_create;
|
if (csync_statedb_create_tables(ctx) < 0) {
|
||||||
|
recreate_db = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0) {
|
if (recreate_db) {
|
||||||
char *statedb_tmp;
|
char *statedb_tmp;
|
||||||
int rc;
|
int rc;
|
||||||
retry_create:
|
|
||||||
if (asprintf(&statedb_tmp, "%s.ctmp", ctx->statedb.file) < 0) {
|
if (asprintf(&statedb_tmp, "%s.ctmp", ctx->statedb.file) < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue