/*
Copyright (C) Andrew Tridgell 1996
Copyright (C) Paul Mackerras 1996
- Copyright (C) 2001 by Martin Pool <mbp@samba.org>
+ Copyright (C) 2001, 2002 by Martin Pool <mbp@samba.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* generate and receive file lists */
+/** @file flist.c
+ * Generate and receive file lists
+ *
+ * @todo Get rid of the string_area optimization. Efficiently
+ * allocating blocks is the responsibility of the system's malloc
+ * library, not of rsync.
+ *
+ **/
#include "rsync.h"
#if SUPPORT_HARD_LINKS
if (preserve_hard_links && S_ISREG(file->mode)) {
- write_int(f,(int)file->dev);
- write_int(f,(int)file->inode);
+ if (remote_version < 26) {
+ /* 32-bit dev_t and ino_t */
+ write_int(f,(int)file->dev);
+ write_int(f,(int)file->inode);
+ } else {
+ /* 64-bit dev_t and ino_t */
+ write_longint(f, (int64) file->dev);
+ write_longint(f, (int64) file->inode);
+ }
}
#endif
#if SUPPORT_HARD_LINKS
if (preserve_hard_links && S_ISREG(file->mode)) {
- file->dev = read_int(f);
- file->inode = read_int(f);
+ if (remote_version < 26) {
+ file->dev = read_int(f);
+ file->inode = read_int(f);
+ } else {
+ file->dev = read_longint(f);
+ file->inode = read_longint(f);
+ }
}
#endif
}
}
+ /* FIXME: There is a bug here when filenames are repeated more
+ * than once, because we don't handle freed files when doing
+ * the comparison. */
+
if (strip_root) {
/* we need to strip off the root directory in the case
of relative paths, but this must be done _after_
/* -*- c-file-style: "linux" -*-
Copyright (C) 1998-2001 by Andrew Tridgell <tridge@samba.org>
- Copyright (C) 2000-2001 by Martin Pool <mbp@samba.org>
+ Copyright (C) 2000, 2001, 2002 by Martin Pool <mbp@samba.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
char const *hardlinks = "no ";
char const *links = "no ";
char const *ipv6 = "no ";
+ STRUCT_STAT *dumstat;
#ifdef HAVE_SOCKETPAIR
got_socketpair = "";
"Copyright (C) 1996-2001 by Andrew Tridgell and others\n");
rprintf(f, "<http://rsync.samba.org/>\n");
rprintf(f, "Capabilities: %d-bit files, %ssocketpairs, "
- "%shard links, %ssymlinks, batchfiles, %sIPv6\n\n",
+ "%shard links, %ssymlinks, batchfiles, %sIPv6,\n",
(int) (sizeof(OFF_T) * 8),
got_socketpair, hardlinks, links, ipv6);
+ /* Note that this field may not have type ino_t. It depends
+ * on the complicated interaction between largefile feature
+ * macros. */
+ rprintf(f, " %d-bit inums, %d-bit INO_T\n",
+ (int) (sizeof(dumstat->st_ino) * 8),
+ (int) (sizeof(INO_T) * 8));
+
#ifdef NO_INT64
rprintf(f, "WARNING: no 64-bit integers on this platform!\n");
#endif
/*
Copyright (C) by Andrew Tridgell 1996, 2000
Copyright (C) Paul Mackerras 1996
- Copyright (C) 2001 by Martin Pool <mbp@samba.org>
+ Copyright (C) 2001, 2002 by Martin Pool <mbp@samba.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#define SAME_TIME (1<<7)
/* update this if you make incompatible changes */
-#define PROTOCOL_VERSION 25
+#define PROTOCOL_VERSION 26
/* We refuse to interoperate with versions that are not in this range.
* Note that we assume we'll work with later versions: the onus is on
#elif HAVE_LONGLONG
#define int64 long long
#else
+/* As long as it gets... */
#define int64 off_t
#define NO_INT64
#endif
-#if HAVE_SHORT_INO_T
-# define INO_T uint32
-#elif HAVE_INO_T
-# define INO_T ino_t
-#else
-# define INO_T unsigned
-#endif
+/* We want to manipulate 64-bit inums. On some systems
+ * STRUCT_STAT.st_ino can be bigger than an ino_t depending on the
+ * combination of largefile feature macros. Rather than try to guess,
+ * we just internally store them in the largest know type. Hopefully
+ * it's enough. */
+#define INO_T int64
#ifndef MIN
#define MIN(a,b) ((a)<(b)?(a):(b))