From: VMware, Inc <> Date: Tue, 13 Mar 2012 20:10:54 +0000 (-0700) Subject: Allow compiling hgfs and dnd library code on Android X-Git-Tag: 2012.03.13-651368~24 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d5dbe1f0d62aebfba490152133a84d95c4ee85ff;p=thirdparty%2Fopen-vm-tools.git Allow compiling hgfs and dnd library code on Android Signed-off-by: Dmitry Torokhov --- diff --git a/open-vm-tools/lib/hgfs/hgfsUtil.c b/open-vm-tools/lib/hgfs/hgfsUtil.c index c39af34f2..c2f8a88c0 100644 --- a/open-vm-tools/lib/hgfs/hgfsUtil.c +++ b/open-vm-tools/lib/hgfs/hgfsUtil.c @@ -47,6 +47,12 @@ #include "hgfsUtil.h" #include "vmware.h" #include "vm_basic_asm.h" +#ifdef __APPLE__ +#include +#ifndef TARGET_OS_IPHONE +#define TARGET_OS_IPHONE 0 +#endif +#endif #ifndef _WIN32 /* @@ -109,7 +115,7 @@ int HgfsConvertFromNtTimeNsec(struct timespec *unixTime, // OUT: Time in UNIX format uint64 ntTime) // IN: Time in Windows NT format { -#ifndef VM_X86_64 +#if !defined(VM_X86_64) && !defined(__ANDROID__) && !TARGET_OS_IPHONE uint32 sec; uint32 nsec; @@ -134,7 +140,7 @@ HgfsConvertFromNtTimeNsec(struct timespec *unixTime, // OUT: Time in UNIX format return -1; } -#ifndef VM_X86_64 +#if !defined(VM_X86_64) && !defined(__ANDROID__) && !TARGET_OS_IPHONE Div643232(ntTime - UNIX_EPOCH, 10000000, &sec, &nsec); unixTime->tv_sec = sec; unixTime->tv_nsec = nsec * 100; diff --git a/open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c b/open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c index 31a8a80a9..e7fea758f 100644 --- a/open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c +++ b/open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c @@ -54,6 +54,14 @@ #ifdef sun #define ACCESSPERMS (S_IRWXU | S_IRWXG | S_IRWXO) #endif +#ifdef __ANDROID__ +/* + * Android doesn't support setmntent(), endmntent() or MOUNTED. + */ +#define NO_SETMNTENT +#define NO_ENDMNTENT +#define ACCESSPERMS (S_IRWXU | S_IRWXG | S_IRWXO) +#endif /* @@ -504,8 +512,11 @@ DnD_CheckBlockFuse(int blockFd) // IN } if (size != sizeof(VMBLOCK_FUSE_READ_RESPONSE)) { - LOG(4, ("%s: Response too short (%"FMTSZ"d vs. %"FMTSZ"u).\n", - __func__, size, sizeof(VMBLOCK_FUSE_READ_RESPONSE))); + /* + * Refer to bug 817761 of casting size to size_t. + */ + LOG(4, ("%s: Response too short (%"FMTSZ"u vs. %"FMTSZ"u).\n", + __func__, (size_t)size, sizeof(VMBLOCK_FUSE_READ_RESPONSE))); return FALSE; } @@ -546,6 +557,11 @@ DnD_TryInitVmblock(const char *vmbFsName, // IN mode_t vmbDeviceMode, // IN Bool (*verifyBlock)(int fd)) // IN { +#if defined NO_SETMNTENT || defined NO_ENDMNTENT + NOT_IMPLEMENTED(); + errno = ENOSYS; + return -1; +#else Bool found = FALSE; int blockFd = -1; char *realMntPoint; @@ -609,6 +625,7 @@ DnD_TryInitVmblock(const char *vmbFsName, // IN out: free(realMntPoint); return blockFd; +#endif }