Fossil SCM

Minor code cleanup for autosync attempts to make the code more legible, no change in functionality.

andybradford 2014-06-13 14:49 trunk
Commit 2f9c2ea5a5bdb3f825fe350664ed38c098eac9bc
1 file changed +8 -3
+8 -3
--- src/sync.c
+++ src/sync.c
@@ -83,13 +83,18 @@
8383
*/
8484
int autosync_loop(int flags, int nTries){
8585
int n = 0;
8686
int rc = 0;
8787
while( (n==0 || n < nTries) && (rc = autosync(flags)) ){
88
- if( rc ) fossil_warning("Autosync failed%s",
89
- ++n < nTries ? ", making another attempt." : ".");
90
- if( n < nTries ) sqlite3_sleep(500);
88
+ if( rc ){
89
+ if( ++n < nTries ){
90
+ fossil_warning("Autosync failed, making another attempt.");
91
+ sqlite3_sleep(500);
92
+ }else{
93
+ fossil_warning("Autosync failed.");
94
+ }
95
+ }
9196
}
9297
return rc;
9398
}
9499
95100
/*
96101
--- src/sync.c
+++ src/sync.c
@@ -83,13 +83,18 @@
83 */
84 int autosync_loop(int flags, int nTries){
85 int n = 0;
86 int rc = 0;
87 while( (n==0 || n < nTries) && (rc = autosync(flags)) ){
88 if( rc ) fossil_warning("Autosync failed%s",
89 ++n < nTries ? ", making another attempt." : ".");
90 if( n < nTries ) sqlite3_sleep(500);
 
 
 
 
 
91 }
92 return rc;
93 }
94
95 /*
96
--- src/sync.c
+++ src/sync.c
@@ -83,13 +83,18 @@
83 */
84 int autosync_loop(int flags, int nTries){
85 int n = 0;
86 int rc = 0;
87 while( (n==0 || n < nTries) && (rc = autosync(flags)) ){
88 if( rc ){
89 if( ++n < nTries ){
90 fossil_warning("Autosync failed, making another attempt.");
91 sqlite3_sleep(500);
92 }else{
93 fossil_warning("Autosync failed.");
94 }
95 }
96 }
97 return rc;
98 }
99
100 /*
101

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button