From: Oliver Kurth Date: Fri, 15 Sep 2017 18:23:52 +0000 (-0700) Subject: Add error logging to lib/file/file.c create folder functions X-Git-Tag: stable-10.2.0~85 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e854fc4e547c5f7f4c989e38e233e6567d588386;p=thirdparty%2Fopen-vm-tools.git Add error logging to lib/file/file.c create folder functions --- diff --git a/open-vm-tools/lib/file/file.c b/open-vm-tools/lib/file/file.c index 1bed237bf..2f14734ff 100644 --- a/open-vm-tools/lib/file/file.c +++ b/open-vm-tools/lib/file/file.c @@ -352,6 +352,11 @@ File_CreateDirectoryEx(const char *pathName, // IN: { int err = FileCreateDirectory(pathName, mask); + if (err != 0) { + Log(LGPFX" %s: Failed to create %s. Error = %d\n", + __FUNCTION__, pathName, err); + } + return err == 0; } @@ -401,8 +406,14 @@ File_EnsureDirectoryEx(const char *pathName, // IN: int mask) // IN: { int err = FileCreateDirectory(pathName, mask); + Bool success = ((err == 0) || (err == EEXIST)); - return ((err == 0) || (err == EEXIST)); + if (!success) { + Log(LGPFX" %s: Failed to create %s. Error = %d\n", + __FUNCTION__, pathName, err); + } + + return success; } @@ -1646,7 +1657,7 @@ File_CreateDirectoryHierarchyEx(const char *pathName, // IN: while (TRUE) { Bool failed; char *temp; -#if defined(_WIN32) +#if defined(_WIN32) DWORD status; DWORD statusNew; #endif