aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kahles <david.kahles96@gmail.com>2016-07-21 13:59:54 +0200
committerAndreas Schneider <asn@cryptomilk.org>2018-02-09 10:36:43 +0100
commit0890425eab6231a981bb31e8dafb0b3be9b44def (patch)
tree0920f159f8b01c7cd4b20aed38f235e3fcfcb381
parentc23cae6493c3909f98f1377379b07363695e0435 (diff)
downloadcsync-0890425eab6231a981bb31e8dafb0b3be9b44def.tar.gz
csync-0890425eab6231a981bb31e8dafb0b3be9b44def.tar.xz
csync-0890425eab6231a981bb31e8dafb0b3be9b44def.zip
Get rid of unnecessary goto statements
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r--src/csync_update.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/csync_update.c b/src/csync_update.c
index 87bf05e..8242297 100644
--- a/src/csync_update.c
+++ b/src/csync_update.c
@@ -111,9 +111,9 @@ static int _csync_detect_update(CSYNC *ctx, const char *file,
/* we have an update! */
if (fs->mtime > tmp->modtime) {
st->instruction = CSYNC_INSTRUCTION_EVAL;
- goto out;
+ } else {
+ st->instruction = CSYNC_INSTRUCTION_NONE;
}
- st->instruction = CSYNC_INSTRUCTION_NONE;
} else {
/* check if the file has been renamed */
if (ctx->current == LOCAL_REPLICA) {
@@ -122,15 +122,14 @@ static int _csync_detect_update(CSYNC *ctx, const char *file,
if (tmp && tmp->inode == fs->inode) {
/* inode found so the file has been renamed */
st->instruction = CSYNC_INSTRUCTION_RENAME;
- goto out;
} else {
/* file not found in statedb */
st->instruction = CSYNC_INSTRUCTION_NEW;
- goto out;
}
+ } else {
+ /* remote and file not found in statedb */
+ st->instruction = CSYNC_INSTRUCTION_NEW;
}
- /* remote and file not found in statedb */
- st->instruction = CSYNC_INSTRUCTION_NEW;
}
} else {
st->instruction = CSYNC_INSTRUCTION_NEW;