From: VMware, Inc <> Date: Thu, 17 Jun 2010 22:05:52 +0000 (-0700) Subject: Report correct error from POSIX version of "HgfsPlatformFileExists" X-Git-Tag: 2010.06.16-268169~56 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0af060be7627ecfd0cd97e87d9fb4f4bfa793c18;p=thirdparty%2Fopen-vm-tools.git Report correct error from POSIX version of "HgfsPlatformFileExists" Current implementation always reports -1 when the file does not exist. Fixing it to report actual error - usually ENOENT. Signed-off-by: Marcelo Vanzin --- diff --git a/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c b/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c index 7ee215427..237572224 100644 --- a/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c +++ b/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c @@ -3850,7 +3850,12 @@ HgfsPlatformDeleteDirByHandle(HgfsHandle file, // IN: File being delete HgfsInternalStatus HgfsPlatformFileExists(char *localTargetName) // IN: Full file path utf8 encoding { - return Posix_Access(localTargetName, F_OK); + int err; + err = Posix_Access(localTargetName, F_OK); + if (-1 == err) { + err = errno; + } + return err; }