#include "rsync.h"
int remote_protocol = 0;
-int flist_extra_cnt = 0; /* count of file-list extras that everyone gets */
+int file_extra_cnt = 0; /* count of file-list extras that everyone gets */
extern int verbose;
extern int am_server;
extern int basis_dir_cnt;
extern int prune_empty_dirs;
extern int protocol_version;
+extern int preserve_uid;
+extern int preserve_gid;
extern char *dest_option;
void setup_protocol(int f_out,int f_in)
{
if (am_sender)
- flist_extra_cnt += PTR_EXTRA_LEN;
+ file_extra_cnt += PTR_EXTRA_LEN;
else
- flist_extra_cnt++;
+ file_extra_cnt++;
if (preserve_uid)
- preserve_uid = ++flist_extra_cnt;
+ preserve_uid = ++file_extra_cnt;
if (preserve_gid)
- preserve_gid = ++flist_extra_cnt;
+ preserve_gid = ++file_extra_cnt;
if (remote_protocol == 0) {
if (!read_batch)
extern int preserve_gid;
extern int relative_paths;
extern int implied_dirs;
-extern int flist_extra_cnt;
+extern int file_extra_cnt;
extern int ignore_perishable;
extern int non_perishable_cnt;
extern int prune_empty_dirs;
static void send_file_entry(struct file_struct *file, int f, int ndx)
{
- unsigned short flags;
static time_t modtime;
static mode_t mode;
static int64 dev;
char fname[MAXPATHLEN];
int first_hlink_ndx = -1;
int l1, l2;
+ int flags;
f_name(file, fname);
}
static struct file_struct *recv_file_entry(struct file_list *flist,
- unsigned short flags, int f)
+ int flags, int f)
{
static time_t modtime;
static mode_t mode;
char thisname[MAXPATHLEN];
unsigned int l1 = 0, l2 = 0;
int alloc_len, basename_len, dirname_len, linkname_len;
- int extra_len = flist_extra_cnt * EXTRA_LEN;
+ int extra_len = file_extra_cnt * EXTRA_LEN;
int first_hlink_ndx = -1;
OFF_T file_length;
char *basename, *dirname, *bp;
char thisname[MAXPATHLEN];
char linkname[MAXPATHLEN];
int alloc_len, basename_len, dirname_len, linkname_len;
- int extra_len = flist_extra_cnt * EXTRA_LEN;
+ int extra_len = file_extra_cnt * EXTRA_LEN;
char *basename, *dirname, *bp;
if (!flist || !flist->count) /* Ignore lastdir when invalid. */
/* Only called for temporary file_struct entries created by make_file(). */
void unmake_file(struct file_struct *file)
{
- int extra_cnt = flist_extra_cnt + LEN64_BUMP(file);
+ int extra_cnt = file_extra_cnt + LEN64_BUMP(file);
#if EXTRA_ROUNDING > 0
if (extra_cnt & EXTRA_ROUNDING)
extra_cnt = (extra_cnt | EXTRA_ROUNDING) + 1;
static struct file_struct *send_file_name(int f, struct file_list *flist,
char *fname, STRUCT_STAT *stp,
- unsigned short flags)
+ int flags)
{
struct file_struct *file;
struct file_list *recv_file_list(int f)
{
struct file_list *flist;
- unsigned short flags;
+ int flags;
int64 start_read;
rprintf(FLOG, "receiving file list\n");
const char basename[1]; /* The basename (AKA filename) follows */
};
-extern int flist_extra_cnt;
+extern int file_extra_cnt;
extern int preserve_uid;
extern int preserve_gid;
#define SUM_EXTRA_CNT ((MD4_SUM_LENGTH + EXTRA_LEN - 1) / EXTRA_LEN)
#define REQ_EXTRA(f,ndx) ((union file_extras*)(f) - (ndx))
-#define OPT_EXTRA(f,bump) ((union file_extras*)(f) - flist_extra_cnt - 1 - (bump))
+#define OPT_EXTRA(f,bump) ((union file_extras*)(f) - file_extra_cnt - 1 - (bump))
#define LEN64_BUMP(f) ((f)->flags & FLAG_LENGTH64 ? 1 : 0)
#define HLINK_BUMP(f) (F_IS_HLINKED(f) ? 1 : 0)