Skip to content

Commit d927184

Browse files
Clifford Wolflge
authored andcommitted
Various small cleanups
1 parent a973c47 commit d927184

File tree

8 files changed

+10
-6
lines changed

8 files changed

+10
-6
lines changed

cfgfile_parser.y

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <stdio.h>
2525
#include <string.h>
2626
#include <fnmatch.h>
27+
#include <ctype.h>
2728

2829
struct csync_group *csync_group = 0;
2930
struct csync_prefix *csync_prefix = 0;

check.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ int csync_check_mod(const char *file, int recursive, int ignnoent, int init_run)
163163
}
164164

165165
if ( check_type>0 && lstat(prefixsubst(file), &st) != 0 ) {
166-
if ( ignnoent ) return;
166+
if ( ignnoent ) return 0;
167167
csync_fatal("This should not happen: "
168168
"Can't stat %s.\n", file);
169169
}

conn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ static int dummy_ssl_verify_callback(int preverify_ok, X509_STORE_CTX *x509_ctx)
109109

110110
int conn_activate_ssl(int role)
111111
{
112-
static sslinit = 0;
112+
static int sslinit = 0;
113113

114114
if (conn_usessl)
115115
return 0;

csync2.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include <assert.h>
3636
#include <errno.h>
3737
#include <signal.h>
38+
#include <ctype.h>
3839

3940
#ifdef REAL_DBDIR
4041
# undef DBDIR

csync2.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ extern int conn_write(const void *buf, size_t count);
7777

7878
extern void conn_printf(const char *fmt, ...);
7979
extern int conn_fgets(char *s, int size);
80+
extern int conn_gets(char *s, int size);
8081

8182

8283
/* db.c */

error.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
#include <stdlib.h>
2525
#include <string.h>
2626
#include <time.h>
27+
#include <sys/types.h>
28+
#include <unistd.h>
2729

2830
long csync_last_printtime = 0;
2931
FILE *csync_timestamp_out = 0;
@@ -47,7 +49,7 @@ void csync_printtime()
4749
strftime(ftbuffer, 128, "%Y-%m-%d %H:%M:%S %Z (GMT%z)", localtime(&now));
4850

4951
if (csync_timestamp_out)
50-
fprintf(csync_timestamp_out, "<%d> TIMESTAMP: %s\n", getpid(), ftbuffer);
52+
fprintf(csync_timestamp_out, "<%d> TIMESTAMP: %s\n", (int)getpid(), ftbuffer);
5153

5254
if (csync_timestamps) {
5355
if (csync_server_child_pid)
@@ -70,7 +72,7 @@ void csync_printtotaltime()
7072

7173
if (csync_timestamp_out)
7274
fprintf(csync_timestamp_out, "<%d> TOTALTIME: %d:%02d:%02d\n",
73-
getpid(), seconds / (60*60), (seconds/60) % 60, seconds % 60);
75+
(int)getpid(), seconds / (60*60), (seconds/60) % 60, seconds % 60);
7476

7577
if (csync_timestamps) {
7678
if (csync_server_child_pid)

rsync.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ int csync_recv_file(FILE *out)
112112

113113
int csync_rs_check(const char *filename, int isreg)
114114
{
115-
FILE *basis_file, *sig_file;
115+
FILE *basis_file = 0, *sig_file = 0;
116116
char buffer1[512], buffer2[512];
117117
int rc, chunk, found_diff = 0;
118118
int backup_errno;

update.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,6 @@ void csync_update_file_del(const char *peername,
259259

260260
got_error:
261261
if (auto_resolve_run)
262-
got_error_in_autoresolve:
263262
csync_debug(0, "ERROR: Auto-resolving failed. Giving up.\n");
264263
csync_debug(1, "File stays in dirty state. Try again later...\n");
265264
}

0 commit comments

Comments
 (0)