WIMStruct *w;
int extract_flags;
const char *output_dir;
+ unsigned num_lutimes_warnings;
};
/*
wim_timestamp_to_timeval(dentry->d_inode->last_access_time, &tv[0]);
wim_timestamp_to_timeval(dentry->d_inode->last_write_time, &tv[1]);
if (lutimes(output_path, tv) != 0) {
- WARNING("Failed to set timestamp on file `%s': %s",
- output_path, strerror(errno));
+ if (errno != ENOSYS || args->num_lutimes_warnings < 10) {
+ WARNING("Failed to set timestamp on file `%s': %s",
+ output_path, strerror(errno));
+ args->num_lutimes_warnings++;
+ }
}
return 0;
}
return ret;
struct extract_args args = {
- .w = w,
- .extract_flags = extract_flags,
- .output_dir = output_dir,
+ .w = w,
+ .extract_flags = extract_flags,
+ .output_dir = output_dir,
+ .num_lutimes_warnings = 0,
};
ret = for_dentry_in_tree(wim_root_dentry(w), extract_dentry, &args);
* files are expected to be hard linked together in the other directory tree.
*/
+#include "config.h"
+
+
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdbool.h>
#include <sys/stat.h>
+#ifdef HAVE_ATTR_XATTR_H
#include <attr/xattr.h>
+#endif
#include <assert.h>
typedef uint64_t u64;
close(fd2);
}
+#ifdef HAVE_ATTR_XATTR_H
/* Compares an extended attribute of the files. */
static void cmp_xattr(const char *file1, const char *file2,
const char *xattr_name, ssize_t max_size,
}
free(buf1);
free(buf2);
+ fprintf(stderr, "tree-cmp: Warning: cannot compare xattrs of `%s' and `%s'\n",
+ file1, file2);
+ fprintf(stderr, " You need to install the attr development files for this.\n");
}
/* Compares all alternate data streams of the files */
free(list2);
}
}
+#endif
/* Compares special NTFS data of the files, as accessed through extended
* attributes. */
static void special_cmp(const char *file1, const char *file2)
{
+#ifdef HAVE_ATTR_XATTR_H
cmp_xattr(file1, file2, "system.ntfs_acl", 0, false);
cmp_xattr(file1, file2, "system.ntfs_attrib", 0, false);
cmp_xattr(file1, file2, "system.ntfs_dos_name", 0, true);
cmp_xattr(file1, file2, "system.ntfs_reparse_data", 0, true);
cmp_xattr(file1, file2, "system.ntfs_times", 16, false);
cmp_ads(file1, file2);
+#else
+ fprintf(stderr, "tree-cmp: Warning: cannot compare xattrs of `%s' and `%s'\n",
+ file1, file2);
+ fprintf(stderr, " You need to install the attr development files for this.\n");
+#endif
}
if (S_ISREG(st1.st_mode) && st1.st_size != st2.st_size)
difference("Sizes of `%s' and `%s' are not the same",
file1, file2);
+#if 0
if (ntfs_mode && st1.st_atime != st2.st_atime)
difference("Access times of `%s' and `%s' are not the same",
file1, file2);
difference("Modification times of `%s' (%x) and `%s' (%x) are "
"not the same",
file1, st1.st_mtime, file2, st2.st_mtime);
-#if 0
if (st1.st_ctime != st2.st_ctime)
difference("Status change times of `%s' and `%s' are not the same",
file1, file2);