diff options
author | taca <taca@pkgsrc.org> | 2009-09-22 07:08:05 +0000 |
---|---|---|
committer | taca <taca@pkgsrc.org> | 2009-09-22 07:08:05 +0000 |
commit | d8cc99aaa72a5cb85c6139079aab82bd0ada4259 (patch) | |
tree | 4b58cb3861128aeb0c9b475b0ca2fcee7da4a896 /sysutils/open-vm-tools/patches | |
parent | 1dce2c1c7c46382c1b5d26dbe0551427f191d451 (diff) | |
download | pkgsrc-d8cc99aaa72a5cb85c6139079aab82bd0ada4259.tar.gz |
Build problem with 64bit time_t, refering to nonaka's blog:
http://d.hatena.ne.jp/nonakap/20090305/p3
Diffstat (limited to 'sysutils/open-vm-tools/patches')
-rw-r--r-- | sysutils/open-vm-tools/patches/patch-by | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/sysutils/open-vm-tools/patches/patch-by b/sysutils/open-vm-tools/patches/patch-by new file mode 100644 index 00000000000..1a7f05f7d47 --- /dev/null +++ b/sysutils/open-vm-tools/patches/patch-by @@ -0,0 +1,60 @@ +$NetBSD: patch-by,v 1.1 2009/09/22 07:08:05 taca Exp $ + +--- lib/hgfs/hgfsUtil.c.orig 2008-08-08 16:01:54.000000000 +0900 ++++ lib/hgfs/hgfsUtil.c +@@ -95,24 +95,19 @@ int + HgfsConvertFromNtTimeNsec(struct timespec *unixTime, // OUT: Time in UNIX format + uint64 ntTime) // IN: Time in Windows NT format + { +-#ifndef VM_X86_64 + uint32 sec; + uint32 nsec; + + ASSERT(unixTime); +- /* We assume that time_t is 32bit */ +- ASSERT_ON_COMPILE(sizeof (unixTime->tv_sec) == 4); + +- /* Cap NT time values that are outside of Unix time's range */ +- +- if (ntTime >= UNIX_S32_MAX) { +- unixTime->tv_sec = 0x7FFFFFFF; +- unixTime->tv_nsec = 0; +- return 1; +- } +-#else +- ASSERT(unixTime); +-#endif ++ if (sizeof(unixTime->tv_sec) == 4) { ++ /* Cap NT time values that are outside of Unix time's range */ ++ if (ntTime >= UNIX_S32_MAX) { ++ unixTime->tv_sec = 0x7FFFFFFF; ++ unixTime->tv_nsec = 0; ++ return 1; ++ } ++ } + + if (ntTime < UNIX_EPOCH) { + unixTime->tv_sec = 0; +@@ -120,14 +115,14 @@ HgfsConvertFromNtTimeNsec(struct timespe + return -1; + } + +-#ifndef VM_X86_64 +- Div643232(ntTime - UNIX_EPOCH, 10000000, &sec, &nsec); +- unixTime->tv_sec = sec; +- unixTime->tv_nsec = nsec * 100; +-#else +- unixTime->tv_sec = (ntTime - UNIX_EPOCH) / 10000000; +- unixTime->tv_nsec = ((ntTime - UNIX_EPOCH) % 10000000) * 100; +-#endif ++ if (sizeof(unixTime->tv_sec) == 4) { ++ Div643232(ntTime - UNIX_EPOCH, 10000000, &sec, &nsec); ++ unixTime->tv_sec = sec; ++ unixTime->tv_nsec = nsec * 100; ++ } else { ++ unixTime->tv_sec = (ntTime - UNIX_EPOCH) / 10000000; ++ unixTime->tv_nsec = ((ntTime - UNIX_EPOCH) % 10000000) * 100; ++ } + + return 0; + } |