pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/sysutils/open-vm-tools Build problem with 64bit time_t...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/d114db6acb8e
branches:  trunk
changeset: 399531:d114db6acb8e
user:      taca <taca%pkgsrc.org@localhost>
date:      Tue Sep 22 07:08:05 2009 +0000

description:
Build problem with 64bit time_t, refering to nonaka's blog:

        http://d.hatena.ne.jp/nonakap/20090305/p3

diffstat:

 sysutils/open-vm-tools/distinfo         |   3 +-
 sysutils/open-vm-tools/patches/patch-by |  60 +++++++++++++++++++++++++++++++++
 2 files changed, 62 insertions(+), 1 deletions(-)

diffs (78 lines):

diff -r 6c9008ab3497 -r d114db6acb8e sysutils/open-vm-tools/distinfo
--- a/sysutils/open-vm-tools/distinfo   Tue Sep 22 06:51:44 2009 +0000
+++ b/sysutils/open-vm-tools/distinfo   Tue Sep 22 07:08:05 2009 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.4 2008/09/14 16:15:05 bjs Exp $
+$NetBSD: distinfo,v 1.5 2009/09/22 07:08:05 taca Exp $
 
 SHA1 (open-vm-tools-2008.08.08-109361.tar.gz) = 1c44c3524cd9cbc5870f1c6065b03a6b31859a25
 RMD160 (open-vm-tools-2008.08.08-109361.tar.gz) = 4ea0a6aa2edda2bc404c865dc5b58f3a177ae411
@@ -53,3 +53,4 @@
 SHA1 (patch-bv) = c15eadcf4968703c9bf4c16d368f7f7b5b39b046
 SHA1 (patch-bw) = 002f3a78a5d0f52d1e1a2cd62f6ad8136f531939
 SHA1 (patch-bx) = acdb1d8f25d4353e0d95ea613ea83580679b4d9f
+SHA1 (patch-by) = c6018a330fdabefd3fc60d3e6e6c95bdf4f7f2bc
diff -r 6c9008ab3497 -r d114db6acb8e sysutils/open-vm-tools/patches/patch-by
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/open-vm-tools/patches/patch-by   Tue Sep 22 07:08:05 2009 +0000
@@ -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;
+ }



Home | Main Index | Thread Index | Old Index