Steve Ortiz
2010-Feb-11  03:51 UTC
DO NOT REPLY [Bug 6276] crtimes.patch does not preserve creation dates on Mac x86_64 only
Wayne,
I tried changing "unsigned long" to "uint32" as you
suggested, but
that doesn't work.
The compiler adds padding to the struct to make the fields 64-bit
aligned and it has the same problem. ?To convince the compiler
that the timespec really should come immediately after the length, the
struct can be packed with the pragma pack directive. ?I tested the
following, and it worked.
@@ -37,10 +37,13 @@
?extern int preserve_perms;
?extern int preserve_executability;
+#pragma pack(push)
+#pragma pack(4)
?struct create_time {
- ? ? ? unsigned long length;
+ ? ? ? uint32 length;
? ? ? ?struct timespec crtime;
?};
+#pragma pack(pop)
?#define RETURN_ERROR_IF(x,e) \
? ? ? ?do { \
> ------- Comment #7 from wayned at samba.org  2010-02-06 15:57 CST -------
> Thanks for the detailed analysis!  I'm thinking that all we need to do
is to
> change "unsigned long" to "uint32" in the create_time
structure.  I've checked
> in that change into the patches repo (both branches).  Would you try that
and
> see if it works?
>
>  +struct create_time {
> -+      unsigned long length;
> ++      uint32 length;
>  +      struct timespec crtime;
>  +};
Seemingly Similar Threads
- DO NOT REPLY [Bug 6276] New: crtimes.patch does not preserve creation dates on Mac x86_64 only
- rsync patch to allow content from one device file to be synced to another device file
- [PATCH] xattrs not set on locked files that already exist on target
- DO NOT REPLY [Bug 5565] New: xattrs not set on locked files that already exist on target
- crtimes discrepancy on PPC
