From: Oliver Kurth Date: Fri, 15 Sep 2017 18:23:54 +0000 (-0700) Subject: deployPkg: Fix duplicate log message issue X-Git-Tag: stable-10.2.0~68 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa18cc61e5f1233cafff489be63b5660d9b8458b;p=thirdparty%2Fopen-vm-tools.git deployPkg: Fix duplicate log message issue Use linebuffer to prevent duplicate log message for forked off processes during customization. --- diff --git a/open-vm-tools/services/plugins/deployPkg/deployPkgLog.c b/open-vm-tools/services/plugins/deployPkg/deployPkgLog.c index a70762a38..943395887 100644 --- a/open-vm-tools/services/plugins/deployPkg/deployPkgLog.c +++ b/open-vm-tools/services/plugins/deployPkg/deployPkgLog.c @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2006-2016 VMware, Inc. All rights reserved. + * Copyright (C) 2006-2017 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 @@ -75,6 +75,9 @@ DeployPkgLog_Open() Str_Strcat(logPath, DIRSEPS "toolsDeployPkg.log", sizeof logPath); _file = fopen(logPath, "w"); if (_file != NULL) { +#ifndef _WIN32 + setlinebuf(_file); +#endif fprintf(_file, "## Starting deploy pkg operation\n"); } }