open-vm-tools: update to 12.0.0
Update patches with the Alpine Linux ones. Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
parent
1642b68d45
commit
fcfd9e4743
15 changed files with 446 additions and 81 deletions
|
@ -8,13 +8,13 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=open-vm-tools
|
||||
PKG_VERSION:=11.3.0
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=12.0.0
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-18090558.tar.gz
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-19345655.tar.gz
|
||||
PKG_SOURCE_URL:=https://github.com/vmware/open-vm-tools/releases/download/stable-$(PKG_VERSION)
|
||||
PKG_HASH:=9bad3ee755340853bf7990e92f3d3880959a73e0749e8aaae62730854368bd2c
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-18090558
|
||||
PKG_HASH:=ea370217a213802f91b01231e28298bbe54134822351fb5cc70255d80ba0e775
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-19345655
|
||||
|
||||
PKG_LICENSE:=LGPL-2.1-or-later
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
@ -47,7 +47,7 @@ endef
|
|||
|
||||
define Package/open-vm-tools-fuse
|
||||
$(call Package/open-vm-tools/Default)
|
||||
DEPENDS:=+open-vm-tools +libfuse
|
||||
DEPENDS:=+open-vm-tools +libfuse3
|
||||
TITLE:=open-vm-tools-fuse
|
||||
MAINTAINER:=Kagurazaka Kotori <kagurazakakotori@gmail.com>
|
||||
endef
|
||||
|
@ -58,6 +58,7 @@ endef
|
|||
|
||||
CONFIGURE_ARGS+= \
|
||||
--without-icu \
|
||||
--disable-containerinfo \
|
||||
--disable-multimon \
|
||||
--disable-docs \
|
||||
--disable-tests \
|
||||
|
@ -103,7 +104,6 @@ define Package/open-vm-tools/install
|
|||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vmware-xferlogs $(1)/bin/
|
||||
|
||||
$(INSTALL_DIR) $(1)/sbin/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/mount.vmhgfs $(1)/sbin/
|
||||
$(INSTALL_BIN) ./files/shutdown $(1)/sbin/
|
||||
|
||||
$(INSTALL_DIR) $(1)/lib/
|
||||
|
|
34
utils/open-vm-tools/patches/0001-werror.patch
Normal file
34
utils/open-vm-tools/patches/0001-werror.patch
Normal file
|
@ -0,0 +1,34 @@
|
|||
From 9a260723b615dc2e5c6c72767656f9397f59eecf Mon Sep 17 00:00:00 2001
|
||||
From: Natanael Copa <ncopa@alpinelinux.org>
|
||||
Date: Thu, 5 Nov 2015 13:19:20 +0000
|
||||
Subject: [PATCH] open-vm-tools: Add --disable-werror configure option
|
||||
|
||||
Packagers will normally not want the -Werror compile option as it may
|
||||
break compilation depending on the platform specific warnings.
|
||||
|
||||
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
|
||||
---
|
||||
configure.ac | 12 +++++++++++-
|
||||
1 file changed, 11 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -1451,7 +1451,17 @@ AC_C_VOLATILE
|
||||
|
||||
### General flags / actions
|
||||
CFLAGS="$CFLAGS -Wall"
|
||||
-CFLAGS="$CFLAGS -Werror"
|
||||
+AC_ARG_ENABLE(
|
||||
+ werror,
|
||||
+ AS_HELP_STRING(
|
||||
+ [--disable-werror],
|
||||
+ [disable compilation with -Werror]),
|
||||
+ [enable_werror="$enableval"],
|
||||
+ [enable_werror="yes"])
|
||||
+
|
||||
+if test "$enable_werror" = "yes"; then
|
||||
+ CFLAGS="$CFLAGS -Werror"
|
||||
+fi
|
||||
|
||||
# -Wno-unknown-pragmas is due to gcc not understanding '#pragma ident'
|
||||
# in Xlib.h on OpenSolaris.
|
26
utils/open-vm-tools/patches/0002-off64_t.patch
Normal file
26
utils/open-vm-tools/patches/0002-off64_t.patch
Normal file
|
@ -0,0 +1,26 @@
|
|||
From 3d6dad8c9202f449bbdff90da5463c1994198883 Mon Sep 17 00:00:00 2001
|
||||
From: Natanael Copa <ncopa@alpinelinux.org>
|
||||
Date: Tue, 17 Nov 2015 10:39:01 +0000
|
||||
Subject: [PATCH] Do not assume that linux and gnu libc are the same thing
|
||||
|
||||
Use __GLIBC__ when testing for GNU libc specific things instead of
|
||||
assuming that __linux__ is GNU libc.
|
||||
|
||||
This is needed for building with musl libc.
|
||||
|
||||
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
|
||||
---
|
||||
lib/file/fileIOPosix.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/lib/file/fileIOPosix.c
|
||||
+++ b/lib/file/fileIOPosix.c
|
||||
@@ -198,7 +198,7 @@ static AlignedPool alignedPool;
|
||||
* are not available in any header file.
|
||||
*/
|
||||
|
||||
-#if defined(__linux__) && !defined(__ANDROID__)
|
||||
+#if defined(__linux__) && defined(__GLIBC__)
|
||||
#if defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64)
|
||||
/*
|
||||
* We want preadv/pwritev. But due to FOB=64, the symbols are -64.
|
|
@ -1,6 +1,20 @@
|
|||
From f587e80663afed5d189f2dd185dea7e4b2bbb105 Mon Sep 17 00:00:00 2001
|
||||
From: Natanael Copa <ncopa@alpinelinux.org>
|
||||
Date: Wed, 18 Nov 2015 09:03:00 +0000
|
||||
Subject: [PATCH] Use configure test for struct timespec
|
||||
|
||||
Use the configure script to test for struct time spec instead of trying
|
||||
to keep track of what platforms has it.
|
||||
|
||||
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
|
||||
---
|
||||
configure.ac | 1 +
|
||||
lib/include/hgfsUtil.h | 8 +-------
|
||||
2 files changed, 2 insertions(+), 7 deletions(-)
|
||||
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -1212,6 +1212,7 @@ AC_TYPE_OFF_T
|
||||
@@ -1441,6 +1441,7 @@ AC_TYPE_OFF_T
|
||||
AC_TYPE_PID_T
|
||||
AC_TYPE_SIZE_T
|
||||
AC_CHECK_MEMBERS([struct stat.st_rdev])
|
||||
|
|
|
@ -1,3 +1,19 @@
|
|||
From 81da70dccfd03e6089be9ec509e43e697b8a58b3 Mon Sep 17 00:00:00 2001
|
||||
From: Natanael Copa <ncopa@alpinelinux.org>
|
||||
Date: Wed, 18 Nov 2015 09:10:14 +0000
|
||||
Subject: [PATCH] Fix definition of ALLPERMS and ACCESSPERMS
|
||||
|
||||
The ALLPERMS and ACCESSPERMS defines are not specified in POSIX so
|
||||
assume it is not there instead of testing for specific implementations.
|
||||
|
||||
This is needed for musl libc.
|
||||
|
||||
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
|
||||
---
|
||||
lib/hgfsServer/hgfsServerLinux.c | 8 +++++---
|
||||
services/plugins/dndcp/dnd/dndLinux.c | 3 +--
|
||||
2 files changed, 6 insertions(+), 5 deletions(-)
|
||||
|
||||
--- a/lib/hgfsServer/hgfsServerLinux.c
|
||||
+++ b/lib/hgfsServer/hgfsServerLinux.c
|
||||
@@ -105,11 +105,13 @@ typedef struct DirectoryEntry {
|
||||
|
@ -28,3 +44,11 @@
|
|||
#define ACCESSPERMS (S_IRWXU | S_IRWXG | S_IRWXO)
|
||||
#endif
|
||||
#ifdef __ANDROID__
|
||||
@@ -62,7 +62,6 @@
|
||||
*/
|
||||
#define NO_SETMNTENT
|
||||
#define NO_ENDMNTENT
|
||||
-#define ACCESSPERMS (S_IRWXU | S_IRWXG | S_IRWXO)
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,33 @@
|
|||
From da7d7951c3b4f11485accf54e8e925c04709ed78 Mon Sep 17 00:00:00 2001
|
||||
From: Natanael Copa <ncopa@alpinelinux.org>
|
||||
Date: Wed, 18 Nov 2015 10:05:07 +0000
|
||||
Subject: [PATCH] Use configure to test for feature instead of platform
|
||||
|
||||
Test for various functions instead of trying to keep track of what
|
||||
platform and what version of the given platform has support for what.
|
||||
|
||||
This should make it easier to port to currently unknown platforms and
|
||||
will solve the issue if a platform add support for a missing feature in
|
||||
the future.
|
||||
|
||||
The features we test for are:
|
||||
- getifaddrs
|
||||
- getauxval
|
||||
- issetugid
|
||||
- __secure_getenv
|
||||
|
||||
This is needed for musl libc.
|
||||
|
||||
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
|
||||
---
|
||||
configure.ac | 4 ++++
|
||||
lib/misc/idLinux.c | 30 +++++++++++-------------
|
||||
lib/nicInfo/nicInfoPosix.c | 11 +++++----
|
||||
3 files changed, 24 insertions(+), 21 deletions(-)
|
||||
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -940,6 +940,7 @@ AC_CHECK_FUNCS(
|
||||
@@ -1169,6 +1169,7 @@ AC_CHECK_FUNCS(
|
||||
|
||||
AC_CHECK_FUNCS([ecvt])
|
||||
AC_CHECK_FUNCS([fcvt])
|
||||
|
@ -8,7 +35,7 @@
|
|||
|
||||
AC_CHECK_FUNC([mkdtemp], [have_mkdtemp=yes])
|
||||
|
||||
@@ -1149,10 +1150,13 @@ fi
|
||||
@@ -1378,10 +1379,13 @@ fi
|
||||
###
|
||||
|
||||
AC_CHECK_HEADERS([crypt.h])
|
||||
|
@ -100,3 +127,15 @@
|
|||
# include <net/if.h>
|
||||
#endif
|
||||
#ifndef NO_DNET
|
||||
@@ -499,10 +503,7 @@ GuestInfoGetNicInfo(unsigned int maxIPv4
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
-#if defined(__FreeBSD__) || \
|
||||
- defined(__APPLE__) || \
|
||||
- defined(USERWORLD) || \
|
||||
- (defined(__linux__) && defined(NO_DNET))
|
||||
+#if defined(NO_DNET) && defined(HAVE_GETIFADDRS)
|
||||
|
||||
char *
|
||||
GuestInfoGetPrimaryIP(void)
|
||||
|
|
|
@ -1,3 +1,15 @@
|
|||
From 716d1d77bf8199e694c71edcb9e0144d74ba7977 Mon Sep 17 00:00:00 2001
|
||||
From: Natanael Copa <ncopa@alpinelinux.org>
|
||||
Date: Wed, 18 Nov 2015 10:41:01 +0000
|
||||
Subject: [PATCH] Use configure test for sys/stat.h include
|
||||
|
||||
This is needed for musl libc.
|
||||
|
||||
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
|
||||
---
|
||||
services/plugins/vix/vixTools.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/services/plugins/vix/vixTools.c
|
||||
+++ b/services/plugins/vix/vixTools.c
|
||||
@@ -66,7 +66,7 @@
|
||||
|
|
|
@ -1,3 +1,21 @@
|
|||
From 5b45a812a5a3e9509021043f83529cccc13af26a Mon Sep 17 00:00:00 2001
|
||||
From: Natanael Copa <ncopa@alpinelinux.org>
|
||||
Date: Tue, 17 Nov 2015 10:57:31 +0000
|
||||
Subject: [PATCH] Rename poll.h to vm_poll.h
|
||||
|
||||
musl libc's system headers pulls in open-vm-tools' poll.h. To avoid this
|
||||
we rename poll.h to vm_poll.h.
|
||||
|
||||
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
|
||||
---
|
||||
lib/asyncsocket/asyncsocket.c | 2 +-
|
||||
lib/hgfsServer/hgfsServer.c | 2 +-
|
||||
lib/include/asyncsocket.h | 2 +-
|
||||
lib/include/pollImpl.h | 2 +-
|
||||
lib/include/{poll.h => vm_poll.h} | 0
|
||||
lib/rpcIn/rpcin.c | 2 +-
|
||||
6 files changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
--- a/lib/asyncsocket/asyncsocket.c
|
||||
+++ b/lib/asyncsocket/asyncsocket.c
|
||||
@@ -87,7 +87,7 @@
|
||||
|
|
|
@ -1,17 +1,40 @@
|
|||
From 42caf4814d8b7dfe21d55012597d81f98fb5cf01 Mon Sep 17 00:00:00 2001
|
||||
From: Natanael Copa <ncopa@alpinelinux.org>
|
||||
Date: Mon, 2 Jan 2017 14:39:27 +0000
|
||||
Subject: [PATCH] use posix strerror_r unless gnu
|
||||
|
||||
---
|
||||
lib/err/errPosix.c | 8 +++++---
|
||||
vgauth/common/VGAuthLog.c | 2 +-
|
||||
2 files changed, 6 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/lib/err/errPosix.c
|
||||
+++ b/lib/err/errPosix.c
|
||||
@@ -61,13 +61,7 @@ ErrErrno2String(Err_Number errorNumber,
|
||||
char *buf, // OUT: return buffer
|
||||
size_t bufSize) // IN: size of buffer
|
||||
@@ -63,11 +63,13 @@ ErrErrno2String(Err_Number errorNumber,
|
||||
{
|
||||
- char *p;
|
||||
-
|
||||
char *p;
|
||||
|
||||
-#if defined(__linux__) && !defined(__ANDROID__)
|
||||
- p = strerror_r(errorNumber, buf, bufSize);
|
||||
-#else
|
||||
+#if defined(__GLIBC__)
|
||||
p = strerror_r(errorNumber, buf, bufSize);
|
||||
#else
|
||||
- p = strerror(errorNumber);
|
||||
-#endif
|
||||
+ char *p = strerror(errorNumber);
|
||||
+ if (strerror_r(errorNumber, buf, bufSize) != 0)
|
||||
+ snprintf(buf, bufSize, "unknown error %i", errorNumber);
|
||||
+ p = buf;
|
||||
+#endif /* defined __GLIBC__ */
|
||||
ASSERT(p != NULL);
|
||||
return p;
|
||||
}
|
||||
--- a/vgauth/common/VGAuthLog.c
|
||||
+++ b/vgauth/common/VGAuthLog.c
|
||||
@@ -210,7 +210,7 @@ LogErrorPosixCodeV(int code,
|
||||
g_vsnprintf(buf, sizeof buf, fmt, args);
|
||||
buf[sizeof buf - 1] = '\0';
|
||||
|
||||
-#ifdef sun
|
||||
+#if !defined(__GLIBC__)
|
||||
strerror_r(code, errMsg, sizeof errMsg);
|
||||
g_warning("[function %s, file %s, line %d], %s, [errno = %d], %s\n",
|
||||
func, file, line, buf, code, errMsg);
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
--- a/lib/file/fileIOPosix.c
|
||||
+++ b/lib/file/fileIOPosix.c
|
||||
@@ -198,7 +198,7 @@ static AlignedPool alignedPool;
|
||||
* are not available in any header file.
|
||||
*/
|
||||
|
||||
-#if defined(__linux__) && !defined(__ANDROID__)
|
||||
+#if 0
|
||||
#if defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64)
|
||||
/*
|
||||
* We want preadv/pwritev. But due to FOB=64, the symbols are -64.
|
|
@ -1,12 +1,101 @@
|
|||
From cf21ccdef4fe5e749fc10403afc3d9340a6d10dd Mon Sep 17 00:00:00 2001
|
||||
From: Natanael Copa <ncopa@alpinelinux.org>
|
||||
Date: Mon, 2 Jan 2017 15:25:32 +0000
|
||||
Subject: [PATCH] use off64_t instead of loff_t
|
||||
|
||||
---
|
||||
vmhgfs-fuse/file.c | 12 ++++++------
|
||||
vmhgfs-fuse/fsutil.c | 2 +-
|
||||
vmhgfs-fuse/fsutil.h | 8 ++------
|
||||
3 files changed, 9 insertions(+), 13 deletions(-)
|
||||
|
||||
--- a/vmhgfs-fuse/file.c
|
||||
+++ b/vmhgfs-fuse/file.c
|
||||
@@ -547,7 +547,7 @@ static int
|
||||
HgfsDoRead(HgfsHandle handle, // IN: Handle for this file
|
||||
char *buf, // OUT: Buffer to copy data into
|
||||
size_t count, // IN: Number of bytes to read
|
||||
- loff_t offset) // IN: Offset at which to read
|
||||
+ off64_t offset) // IN: Offset at which to read
|
||||
{
|
||||
HgfsReq *req;
|
||||
HgfsOp opUsed;
|
||||
@@ -708,11 +708,11 @@ ssize_t
|
||||
HgfsRead(struct fuse_file_info *fi, // IN: File info struct
|
||||
char *buf, // OUT: User buffer to copy data into
|
||||
size_t count, // IN: Number of bytes to read
|
||||
- loff_t offset) // IN: Offset at which to read
|
||||
+ off64_t offset) // IN: Offset at which to read
|
||||
{
|
||||
int result = 0;
|
||||
char *buffer = buf;
|
||||
- loff_t curOffset = offset;
|
||||
+ off64_t curOffset = offset;
|
||||
size_t nextCount, remainingCount = count;
|
||||
uint32 maxIOSize = HgfsMaxIOSize();
|
||||
|
||||
@@ -769,7 +769,7 @@ static int
|
||||
HgfsDoWrite(HgfsHandle handle, // IN: Handle for the file
|
||||
const char *buf, // IN: Buffer containing data
|
||||
size_t count, // IN: Number of bytes to write
|
||||
- loff_t offset) // IN: Offset to begin writing at
|
||||
+ off64_t offset) // IN: Offset to begin writing at
|
||||
{
|
||||
HgfsReq *req;
|
||||
int result = 0;
|
||||
@@ -893,11 +893,11 @@ ssize_t
|
||||
HgfsWrite(struct fuse_file_info *fi, // IN: File info structure
|
||||
const char *buf, // OUT: User buffer to copy data into
|
||||
size_t count, // IN: Number of bytes to read
|
||||
- loff_t offset) // IN: Offset at which to read
|
||||
+ off64_t offset) // IN: Offset at which to read
|
||||
{
|
||||
int result;
|
||||
const char *buffer = buf;
|
||||
- loff_t curOffset = offset;
|
||||
+ off64_t curOffset = offset;
|
||||
size_t nextCount, remainingCount = count;
|
||||
ssize_t bytesWritten = 0;
|
||||
uint32 maxIOSize = HgfsMaxIOSize();
|
||||
--- a/vmhgfs-fuse/fsutil.c
|
||||
+++ b/vmhgfs-fuse/fsutil.c
|
||||
@@ -694,7 +694,7 @@ HgfsStatusConvertToLinux(HgfsStatus hgfs
|
||||
unsigned long
|
||||
HgfsCalcBlockSize(uint64 tsize)
|
||||
{
|
||||
- loff_t used = (tsize + 511) >> 9;
|
||||
+ off64_t used = (tsize + 511) >> 9;
|
||||
return (used > ULONG_MAX) ? ULONG_MAX : used;
|
||||
}
|
||||
|
||||
--- a/vmhgfs-fuse/fsutil.h
|
||||
+++ b/vmhgfs-fuse/fsutil.h
|
||||
@@ -29,6 +29,9 @@
|
||||
|
||||
#include "request.h"
|
||||
#include "vm_basic_types.h"
|
||||
+#ifndef _GNU_SOURCE
|
||||
+#define _GNU_SOURCE
|
||||
+#endif
|
||||
@@ -32,10 +32,6 @@
|
||||
#include "hgfsProto.h"
|
||||
#include <fuse.h>
|
||||
|
||||
-#if defined(__FreeBSD__) || defined(__SOLARIS__) || defined(__APPLE__)
|
||||
-typedef long long loff_t;
|
||||
-#endif
|
||||
-
|
||||
/*
|
||||
* Struct used to pass around attributes.
|
||||
* These aren't just the attributes seen in HgfsAttr[V2]; we add a filename
|
||||
@@ -73,7 +69,7 @@ ssize_t
|
||||
HgfsWrite(struct fuse_file_info *fi,
|
||||
const char *buf,
|
||||
size_t count,
|
||||
- loff_t offset);
|
||||
+ off64_t offset);
|
||||
|
||||
int
|
||||
HgfsRename(const char* from, const char* to);
|
||||
@@ -93,7 +89,7 @@ ssize_t
|
||||
HgfsRead(struct fuse_file_info *fi,
|
||||
char *buf,
|
||||
size_t count,
|
||||
- loff_t offset);
|
||||
+ off64_t offset);
|
||||
|
||||
int
|
||||
HgfsSetattr(const char* path,
|
||||
|
|
73
utils/open-vm-tools/patches/0015-i386-time.patch
Normal file
73
utils/open-vm-tools/patches/0015-i386-time.patch
Normal file
|
@ -0,0 +1,73 @@
|
|||
From 3f0580f2546de8be7acf1bc78a55a257bc638ebe Mon Sep 17 00:00:00 2001
|
||||
From: Bartosz Brachaczek <b.brachaczek@gmail.com>
|
||||
Date: Tue, 12 Nov 2019 14:31:08 +0100
|
||||
Subject: [PATCH] Make HgfsConvertFromNtTimeNsec aware of 64-bit time_t on i386
|
||||
|
||||
I verified that this function behaves as expected on x86_64, i386 with
|
||||
32-bit time_t, and i386 with 64-bit time_t for the following values of
|
||||
ntTtime:
|
||||
|
||||
UNIX_EPOCH-1, UNIX_EPOCH, UNIX_EPOCH+1, UNIX_S32_MAX-1, UNIX_S32_MAX,
|
||||
UNIX_S32_MAX+1, UNIX_S32_MAX*2+1
|
||||
|
||||
I did not verify whether the use of Div643264 is optimal, performance
|
||||
wise.
|
||||
---
|
||||
lib/hgfs/hgfsUtil.c | 34 +++++++++++++++++--------------
|
||||
1 file changed, 19 insertions(+), 15 deletions(-)
|
||||
|
||||
--- a/lib/hgfs/hgfsUtil.c
|
||||
+++ b/lib/hgfs/hgfsUtil.c
|
||||
@@ -110,23 +110,21 @@ HgfsConvertFromNtTimeNsec(struct timespe
|
||||
uint64 ntTime) // IN: Time in Windows NT format
|
||||
{
|
||||
#ifdef __i386__
|
||||
- uint32 sec;
|
||||
- uint32 nsec;
|
||||
+ uint64 sec64;
|
||||
+ uint32 sec32, nsec;
|
||||
+#endif
|
||||
|
||||
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 (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_S32_MAX) {
|
||||
+ unixTime->tv_sec = 0x7FFFFFFF;
|
||||
+ unixTime->tv_nsec = 0;
|
||||
+ return 1;
|
||||
+ }
|
||||
}
|
||||
-#else
|
||||
- ASSERT(unixTime);
|
||||
-#endif
|
||||
|
||||
if (ntTime < UNIX_EPOCH) {
|
||||
unixTime->tv_sec = 0;
|
||||
@@ -135,9 +133,15 @@ HgfsConvertFromNtTimeNsec(struct timespe
|
||||
}
|
||||
|
||||
#ifdef __i386__
|
||||
- Div643232(ntTime - UNIX_EPOCH, 10000000, &sec, &nsec);
|
||||
- unixTime->tv_sec = sec;
|
||||
- unixTime->tv_nsec = nsec * 100;
|
||||
+ if (sizeof (unixTime->tv_sec) == 4) {
|
||||
+ Div643232(ntTime - UNIX_EPOCH, 10000000, &sec32, &nsec);
|
||||
+ unixTime->tv_sec = sec32;
|
||||
+ unixTime->tv_nsec = nsec * 100;
|
||||
+ } else {
|
||||
+ Div643264(ntTime - UNIX_EPOCH, 10000000, &sec64, &nsec);
|
||||
+ unixTime->tv_sec = sec64;
|
||||
+ unixTime->tv_nsec = nsec * 100;
|
||||
+ }
|
||||
#else
|
||||
unixTime->tv_sec = (ntTime - UNIX_EPOCH) / 10000000;
|
||||
unixTime->tv_nsec = ((ntTime - UNIX_EPOCH) % 10000000) * 100;
|
|
@ -1,35 +0,0 @@
|
|||
--- a/lib/hgfs/hgfsUtil.c
|
||||
+++ b/lib/hgfs/hgfsUtil.c
|
||||
@@ -109,7 +109,7 @@ int
|
||||
HgfsConvertFromNtTimeNsec(struct timespec *unixTime, // OUT: Time in UNIX format
|
||||
uint64 ntTime) // IN: Time in Windows NT format
|
||||
{
|
||||
-#ifdef __i386__
|
||||
+#if defined(__i386__) && !__USE_TIME_BITS64
|
||||
uint32 sec;
|
||||
uint32 nsec;
|
||||
|
||||
@@ -134,7 +134,7 @@ HgfsConvertFromNtTimeNsec(struct timespe
|
||||
return -1;
|
||||
}
|
||||
|
||||
-#ifdef __i386__
|
||||
+#if defined(__i386__) && !__USE_TIME_BITS64
|
||||
Div643232(ntTime - UNIX_EPOCH, 10000000, &sec, &nsec);
|
||||
unixTime->tv_sec = sec;
|
||||
unixTime->tv_nsec = nsec * 100;
|
||||
--- a/lib/hgfsServer/hgfsServerLinux.c
|
||||
+++ b/lib/hgfsServer/hgfsServerLinux.c
|
||||
@@ -2573,8 +2573,12 @@ HgfsStatToFileAttr(struct stat *stats,
|
||||
# define FMTTIMET "l"
|
||||
# endif
|
||||
#else
|
||||
+#ifdef __USE_TIME_BITS64
|
||||
+# define FMTTIMET __PRI64
|
||||
+#else
|
||||
# define FMTTIMET "l"
|
||||
#endif
|
||||
+#endif
|
||||
LOG(4, "access: %"FMTTIMET"d/%"FMT64"u \nwrite: %"FMTTIMET"d/%"FMT64"u \n"
|
||||
"attr: %"FMTTIMET"d/%"FMT64"u\n",
|
||||
stats->st_atime, attr->accessTime, stats->st_mtime, attr->writeTime,
|
69
utils/open-vm-tools/patches/010-warnings.patch
Normal file
69
utils/open-vm-tools/patches/010-warnings.patch
Normal file
|
@ -0,0 +1,69 @@
|
|||
--- a/lib/err/errPosix.c
|
||||
+++ b/lib/err/errPosix.c
|
||||
@@ -29,6 +29,7 @@
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
+#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <locale.h>
|
||||
|
||||
--- a/lib/file/fileIOPosix.c
|
||||
+++ b/lib/file/fileIOPosix.c
|
||||
@@ -1741,7 +1741,7 @@ FileIOPreadvInternal(
|
||||
* the library horizon this can go away.
|
||||
*/
|
||||
/* coverity[func_conv] */
|
||||
- if (preadv64 == NULL) {
|
||||
+ if (0) {
|
||||
fret = FileIOPreadvCoalesced(fd, entries, numEntries, offset,
|
||||
totalSize, &bytesRead);
|
||||
break;
|
||||
@@ -1882,7 +1882,7 @@ FileIOPwritevInternal(
|
||||
* the library horizon this can go away.
|
||||
*/
|
||||
/* coverity[func_conv] */
|
||||
- if (pwritev64 == NULL) {
|
||||
+ if (0) {
|
||||
fret = FileIOPwritevCoalesced(fd, entries, numEntries, offset,
|
||||
totalSize, &bytesWritten);
|
||||
break;
|
||||
--- a/lib/hgfsServer/hgfsServerLinux.c
|
||||
+++ b/lib/hgfsServer/hgfsServerLinux.c
|
||||
@@ -32,6 +32,7 @@
|
||||
#define _DARWIN_USE_64_BIT_INODE
|
||||
#endif
|
||||
|
||||
+#include <inttypes.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
@@ -2573,7 +2574,7 @@ HgfsStatToFileAttr(struct stat *stats,
|
||||
# define FMTTIMET "l"
|
||||
# endif
|
||||
#else
|
||||
-# define FMTTIMET "l"
|
||||
+# define FMTTIMET PRId64
|
||||
#endif
|
||||
LOG(4, "access: %"FMTTIMET"d/%"FMT64"u \nwrite: %"FMTTIMET"d/%"FMT64"u \n"
|
||||
"attr: %"FMTTIMET"d/%"FMT64"u\n",
|
||||
@@ -5301,7 +5302,7 @@ HgfsWriteCheckIORange(off_t offset,
|
||||
goto exit;
|
||||
}
|
||||
|
||||
- LOG(6, "%s: File Size limits: 0x%"FMT64"x 0x%"FMT64"x\n",
|
||||
+ LOG(6, "%s: File Size limits: 0x%llx 0x%llx\n",
|
||||
__FUNCTION__, fileSize.rlim_cur, fileSize.rlim_max);
|
||||
|
||||
/*
|
||||
--- a/services/plugins/gdp/gdpPlugin.c
|
||||
+++ b/services/plugins/gdp/gdpPlugin.c
|
||||
@@ -32,7 +32,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/eventfd.h>
|
||||
-#include <sys/poll.h>
|
||||
+#include <poll.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -1227,7 +1227,6 @@ AC_C_VOLATILE
|
||||
|
||||
### General flags / actions
|
||||
CFLAGS="$CFLAGS -Wall"
|
||||
-CFLAGS="$CFLAGS -Werror"
|
||||
|
||||
# -Wno-unknown-pragmas is due to gcc not understanding '#pragma ident'
|
||||
# in Xlib.h on OpenSolaris.
|
Loading…
Reference in a new issue