From: Oliver Kurth Date: Wed, 10 Apr 2019 21:14:53 +0000 (-0700) Subject: Common header file change not applicable to open-vm-tools. X-Git-Tag: stable-11.0.0~145 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=325e244951790d7a848281fdb0236b0f6ee26996;p=thirdparty%2Fopen-vm-tools.git Common header file change not applicable to open-vm-tools. --- diff --git a/open-vm-tools/libDeployPkg/linuxDeployment.c b/open-vm-tools/libDeployPkg/linuxDeployment.c index 1b7bc916a..f9791968b 100644 --- a/open-vm-tools/libDeployPkg/linuxDeployment.c +++ b/open-vm-tools/libDeployPkg/linuxDeployment.c @@ -102,8 +102,10 @@ static const char BACKSLASH = '\\'; static const char* INPROGRESS = "INPROGRESS"; static const char* DONE = "Done"; static const char* ERRORED = "ERRORED"; +#ifndef IMGCUST_UNITTEST static const char* RUNDIR = "/run"; static const char* VARRUNDIR = "/var/run"; +#endif static const char* TMPDIR = "/tmp"; // Possible return codes from perl script @@ -1222,6 +1224,11 @@ Deploy(const char* packageName) TOOLSDEPLOYPKG_ERROR_SUCCESS, NULL); + // Add this macro definition to enable using '/tmp' instead of '/var/run' as + // the cab file deployment directory in unit test. +#ifdef IMGCUST_UNITTEST + baseDirPath = TMPDIR; +#else // PR 2127543, Use /var/run or /run but /tmp firstly if (File_IsDirectory(VARRUNDIR)) { baseDirPath = VARRUNDIR; @@ -1230,6 +1237,7 @@ Deploy(const char* packageName) } else { baseDirPath = TMPDIR; } +#endif // Create a random name dir under base dir path imcDirPathSize = strlen(baseDirPath) + strlen(IMC_DIR_PATH_PATTERN) + 1;