From: John Wolfe Date: Tue, 21 Jul 2020 18:53:00 +0000 (-0700) Subject: ServiceDiscovery: Reducing scope of local variables in checkForWrite(). X-Git-Tag: stable-11.2.0~126 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31d769f152106333e00902432a4bf49158defecd;p=thirdparty%2Fopen-vm-tools.git ServiceDiscovery: Reducing scope of local variables in checkForWrite(). Reducing scope of variables 'clientTimeStamp', 'clientInterval' and 'currentTime' in function 'checkForWrite()'. --- diff --git a/open-vm-tools/services/plugins/serviceDiscovery/serviceDiscovery.c b/open-vm-tools/services/plugins/serviceDiscovery/serviceDiscovery.c index 086f01180..316b793e8 100644 --- a/open-vm-tools/services/plugins/serviceDiscovery/serviceDiscovery.c +++ b/open-vm-tools/services/plugins/serviceDiscovery/serviceDiscovery.c @@ -657,10 +657,6 @@ checkForWrite(ToolsAppCtx *ctx) g_debug("%s: Failed to read necessary information from Namespace DB\n", __FUNCTION__); } else { - gint64 clientTimestamp; - int clientInterval; - gint64 currentTime; - if ((signal != NULL) && (strcmp(signal, "")) && signalLen > 0) { char *token1; char *token2; @@ -672,9 +668,9 @@ checkForWrite(ToolsAppCtx *ctx) token1 = strtok(signal, ","); token2 = strtok(NULL, ","); if (token1 != NULL && token2 != NULL) { - currentTime = GetGuestTimeInMillis(); - clientInterval = (int) g_ascii_strtoll(token1, NULL, 10); - clientTimestamp = g_ascii_strtoll(token2, NULL, 10); + gint64 currentTime = GetGuestTimeInMillis(); + int clientInterval = (int) g_ascii_strtoll(token1, NULL, 10); + gint64 clientTimestamp = g_ascii_strtoll(token2, NULL, 10); if (clientInterval == 0 || clientTimestamp == 0) { g_warning("%s: Wrong value of interval and timestamp",