diff options
author | Wayne Davison <wayned@samba.org> | 2006-12-03 06:44:16 +0000 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2006-12-03 06:44:16 +0000 |
commit | 82ad07c4182f744c07b96a15df4572e559ed7dc8 (patch) | |
tree | 1f6dd4c5f7f72d77dde613a08c1d0e3a8905cc46 /batch.c | |
parent | d144e43bb3ea77bdc9d1dd68a648166970822dd6 (diff) | |
download | rsync-82ad07c4182f744c07b96a15df4572e559ed7dc8.tar.gz rsync-82ad07c4182f744c07b96a15df4572e559ed7dc8.tar.bz2 rsync-82ad07c4182f744c07b96a15df4572e559ed7dc8.zip |
- Typical tranfers now save 12-20 bytes per file because several vars
were moved out of file_struct into an optional member-var setup.
- Renamed and reorganized the FLAG_* defines.
- Use NDX_DONE instead of a literal -1 when sending/checking the
end-of-phase index value.
Diffstat (limited to 'batch.c')
-rw-r--r-- | batch.c | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -36,16 +36,19 @@ extern int always_checksum; extern int do_compression; extern int def_compress_level; extern int protocol_version; +extern int flist_extra_ndx; extern char *batch_name; extern struct filter_list_struct filter_list; +static int tweaked_preserve_uid; +static int tweaked_preserve_gid; static int tweaked_compress_level; static int *flag_ptr[] = { &recurse, /* 0 */ - &preserve_uid, /* 1 */ - &preserve_gid, /* 2 */ + &tweaked_preserve_uid, /* 1 */ + &tweaked_preserve_gid, /* 2 */ &preserve_links, /* 3 */ &preserve_devices, /* 4 */ &preserve_hard_links, /* 5 */ @@ -72,6 +75,8 @@ void write_stream_flags(int fd) { int i, flags; + tweaked_preserve_uid = preserve_uid != 0; + tweaked_preserve_gid = preserve_gid != 0; #if Z_DEFAULT_COMPRESSION == -1 tweaked_compress_level = do_compression ? def_compress_level + 2 : 0; #else @@ -113,6 +118,16 @@ void read_stream_flags(int fd) xfer_dirs = 0; } + if (tweaked_preserve_uid) { + if (!preserve_uid) + preserve_uid = flist_extra_ndx++; + } else + preserve_uid = 0; + if (tweaked_preserve_gid) { + if (!preserve_gid) + preserve_gid = flist_extra_ndx++; + } else + preserve_gid = 0; if (tweaked_compress_level == 0 || tweaked_compress_level == 2) do_compression = 0; else { |