On Dec 12, 2007, at 7:57 AM, Normen Müller wrote:
On Dec 12, 2007, at 1:38 PM, Timothy Wall wrote:
looking at the JRuby version, they've got the mode packed into 16
bits at offset 8. Since PPC is big-endian and X86 is little-
endian, that might be where the difference is.
Try getShort(8) instead of getInt(8); what are the values (in hex)
in either case?
GREAT! Now it works! I will put your name in the source code!!!!
However I guess I still have to modify
int mode = SVNFileUtil.isOSX || SVNFileUtil.isBSD ?
ourSharedMemory.getShort(8) : ourSharedMemory.getShort(16);
I guess it should rather be something like:
int mode = 0
if (SVNFileUtil.isOSX) mode = ourSharedMemory.getShort(8)
if (SVNFileUtil.isBSD) mode = ourSharedMemory.getInt(16);
Otherwise this code will not work on a proper linux system, right?
if (osx) { }
else if (bsd) { }
else { }
Regarding your last question ``what are the values (in hex) in
either case''?
I don't really understand what you are asking me for :-\ Do you
mean the hex value of ``mode'' variable?
yes, that's what I meant.
So to summarize, on OSX the mode field is 16 bits at offset 8 of the
structure, not 32 bits. No difference is detected on little-endian
systems, but the bug is made apparent on big-endian systems.
Checking sys/stat.h, sys/types.h and sys/_types.h shows that mode_t
is 16 bits.