open-vm-tools: fix build on gcc 9.

This commit is contained in:
Leah Neukirchen 2019-08-01 10:20:41 +02:00
parent d24cf57db0
commit 2e895c9a14
2 changed files with 104 additions and 1 deletions

View file

@ -0,0 +1,103 @@
--- hgfsmounter/hgfsmounter.c
+++ hgfsmounter/hgfsmounter.c
@@ -1,5 +1,5 @@
/*********************************************************
- * Copyright (C) 2006-2017 VMware, Inc. All rights reserved.
+ * Copyright (C) 2006-2019 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it
* under the terms of the GNU Lesser General Public License as
* published
@@ -514,11 +514,13 @@ ParseFmask(const char *option, // IN:
option string along with value
HgfsMountInfo *mountInfo, // OUT: mount data
int *flags) // OUT: mount flags
{
+ unsigned short fmask = 0;
ASSERT(option);
ASSERT(mountInfo);
- if (ParseMask(option, &mountInfo->fmask)) {
- LOG("Setting mount fmask to %o\n", mountInfo->fmask);
+ if (ParseMask(option, &fmask)) {
+ LOG("Setting mount fmask to %o\n", fmask);
+ mountInfo->fmask = fmask;
return TRUE;
}
@@ -548,11 +550,13 @@ ParseDmask(const char *option, // IN:
option string along with value
HgfsMountInfo *mountInfo, // OUT: mount data
int *flags) // OUT: mount flags
{
+ unsigned short dmask = 0;
ASSERT(option);
ASSERT(mountInfo);
- if (ParseMask(option, &mountInfo->dmask)) {
- LOG("Setting mount dmask to %o\n", mountInfo->dmask);
+ if (ParseMask(option, &dmask)) {
+ LOG("Setting mount dmask to %o\n", dmask);
+ mountInfo->dmask = dmask;
return TRUE;
}
--- lib/hgfsServer/hgfsServer.c
+++ lib/hgfsServer/hgfsServer.c
@@ -1,5 +1,5 @@
/*********************************************************
- * Copyright (C) 1998-2018 VMware, Inc. All rights reserved.
+ * Copyright (C) 1998-2019 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
@@ -6536,11 +6536,13 @@ HgfsServerRead(HgfsInputParam *input) // IN: Input params
payload = &reply->payload[0];
}
if (payload) {
+ uint32 actualSize = 0;
status = HgfsPlatformReadFile(readFd, input->session, offset,
requiredSize, payload,
- &reply->actualSize);
+ &actualSize);
if (HGFS_ERROR_SUCCESS == status) {
reply->reserved = 0;
+ reply->actualSize = actualSize;
replyPayloadSize = sizeof *reply;
if (readUseDataBuffer) {
@@ -6556,11 +6558,13 @@ HgfsServerRead(HgfsInputParam *input) // IN: Input params
break;
}
case HGFS_OP_READ: {
+ uint32 actualSize = 0;
HgfsReplyRead *reply = replyRead;
status = HgfsPlatformReadFile(readFd, input->session, offset, requiredSize,
- reply->payload, &reply->actualSize);
+ reply->payload, &actualSize);
if (HGFS_ERROR_SUCCESS == status) {
+ reply->actualSize = actualSize;
replyPayloadSize = sizeof *reply + reply->actualSize;
} else {
LOG(4, ("%s: V1 Failed to read-> %d.\n", __FUNCTION__, status));
--- lib/misc/util_misc.c
+++ lib/misc/util_misc.c
@@ -1,5 +1,5 @@
/*********************************************************
- * Copyright (C) 1998-2018 VMware, Inc. All rights reserved.
+ * Copyright (C) 1998-2019 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
@@ -719,8 +719,8 @@ Util_ExpandString(const char *fileName) // IN file path to expand
ASSERT(!freeChunk[i]);
chunks[i] = expand;
if (chunks[i] == NULL) {
- Log("%s: Cannot allocate memory to expand \"%s\" in \"%s\".\n",
- __FUNCTION__, expand, fileName);
+ Log("%s: Cannot allocate memory to expand $ in \"%s\".\n",
+ __FUNCTION__, fileName);
goto out;
}
chunkSize[i] = strlen(expand);

View file

@ -1,7 +1,7 @@
# Template file for 'open-vm-tools'
pkgname=open-vm-tools
version=10.3.10
revision=2
revision=3
_build=12406962
wrksrc="open-vm-tools-${version}-${_build}"
build_style=gnu-configure