From: Oliver Kurth Date: Mon, 6 Jan 2020 23:46:20 +0000 (-0800) Subject: LOG_ONCE changes to variadic just as LOG did recently. X-Git-Tag: stable-11.1.0~88 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=57c8fc2e11d368f4459e6ba43010b7f2fd93cdfd;p=thirdparty%2Fopen-vm-tools.git LOG_ONCE changes to variadic just as LOG did recently. --- diff --git a/open-vm-tools/lib/file/fileIOPosix.c b/open-vm-tools/lib/file/fileIOPosix.c index 32f6cec36..30f01c21b 100644 --- a/open-vm-tools/lib/file/fileIOPosix.c +++ b/open-vm-tools/lib/file/fileIOPosix.c @@ -915,8 +915,8 @@ FileIOCreateRetry(FileIODescriptor *file, // OUT: flags |= O_DIRECT; #elif !defined(__APPLE__) // Mac hosts need this access flag after opening. access &= ~FILEIO_OPEN_UNBUFFERED; - LOG_ONCE((LGPFX" %s reverting to buffered IO on %s.\n", - __FUNCTION__, pathName)); + LOG_ONCE(LGPFX" %s reverting to buffered IO on %s.\n", + __FUNCTION__, pathName); #endif } @@ -1971,8 +1971,8 @@ FileIOPwritevCoalesced( * already checked for retval == -1 above, so the cast * below should be OK. Refer to bug 817761. */ - LOG_ONCE((LGPFX" %s wrote %"FMTSZ"u out of %"FMTSZ"u bytes.\n", - __FUNCTION__, (size_t)retval, leftToWrite)); + LOG_ONCE(LGPFX" %s wrote %"FMTSZ"u out of %"FMTSZ"u bytes.\n", + __FUNCTION__, (size_t)retval, leftToWrite); } buf += retval; @@ -3050,15 +3050,15 @@ void FileIOAligned_PoolExit(void) { if (!alignedPool.lock) { - LOG_ONCE(("%s called without FileIOAligned_Pool lock\n", __FUNCTION__)); + LOG_ONCE("%s called without FileIOAligned_Pool lock\n", __FUNCTION__); return; } MXUser_AcquireExclLock(alignedPool.lock); if (alignedPool.numBusy > 0) { - LOG_ONCE(("%s: %d busy buffers! Proceeding with trepidation.\n", - __FUNCTION__, alignedPool.numBusy)); + LOG_ONCE("%s: %d busy buffers! Proceeding with trepidation.\n", + __FUNCTION__, alignedPool.numBusy); } while (alignedPool.numAlloc > 0) { alignedPool.numAlloc--; @@ -3098,7 +3098,7 @@ FileIOAligned_PoolMalloc(size_t size) // IN: void *buf = NULL; if (!alignedPool.lock) { - LOG_ONCE(("%s called without FileIOAligned_Pool lock\n", __FUNCTION__)); + LOG_ONCE("%s called without FileIOAligned_Pool lock\n", __FUNCTION__); return NULL; } @@ -3160,7 +3160,7 @@ FileIOAligned_PoolFree(void *ptr) // IN: VmTimeType now; if (!alignedPool.lock) { - LOG_ONCE(("%s called without FileIOAligned_Pool lock\n", __FUNCTION__)); + LOG_ONCE("%s called without FileIOAligned_Pool lock\n", __FUNCTION__); return FALSE; } diff --git a/open-vm-tools/lib/include/vm_assert.h b/open-vm-tools/lib/include/vm_assert.h index 5fbdf69a2..bb18cdc97 100644 --- a/open-vm-tools/lib/include/vm_assert.h +++ b/open-vm-tools/lib/include/vm_assert.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2017,2019 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 @@ -246,7 +246,7 @@ void WarningThrottled(uint32 *count, const char *fmt, ...) PRINTF_DECL(2, 3); count = (count + 1) & 1023; \ } while (0) -#define LOG_ONCE(_s) DO_ONCE(Log _s) +#define LOG_ONCE(...) DO_ONCE(Log(__VA_ARGS__)) /* diff --git a/open-vm-tools/modules/shared/vmxnet/net.h b/open-vm-tools/modules/shared/vmxnet/net.h index 731c5f69a..5099c5749 100644 --- a/open-vm-tools/modules/shared/vmxnet/net.h +++ b/open-vm-tools/modules/shared/vmxnet/net.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2016,2019 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 General Public License as published by the @@ -214,7 +214,7 @@ Net_GetNumAdapters(Net_AdapterCount *counts) } else if (Str_Strcasecmp(adapterStr, "e1000e") == 0) { counts->e1000e++; } else { - LOG_ONCE(("%s: unknown adapter: %s\n", __FUNCTION__, adapterStr)); + LOG_ONCE("%s: unknown adapter: %s\n", __FUNCTION__, adapterStr); } free(adapterStr); }