Fossil SCM
Minor code cleanup for autosync attempts to make the code more legible, no change in functionality.
Commit
2f9c2ea5a5bdb3f825fe350664ed38c098eac9bc
Parent
c5a0169786ea7dc…
1 file changed
+8
-3
+8
-3
| --- src/sync.c | ||
| +++ src/sync.c | ||
| @@ -83,13 +83,18 @@ | ||
| 83 | 83 | */ |
| 84 | 84 | int autosync_loop(int flags, int nTries){ |
| 85 | 85 | int n = 0; |
| 86 | 86 | int rc = 0; |
| 87 | 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); | |
| 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 | + } | |
| 91 | 96 | } |
| 92 | 97 | return rc; |
| 93 | 98 | } |
| 94 | 99 | |
| 95 | 100 | /* |
| 96 | 101 |
| --- 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 |