]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Report correct error from POSIX version of "HgfsPlatformFileExists"
authorVMware, Inc <>
Thu, 17 Jun 2010 22:05:52 +0000 (15:05 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Thu, 17 Jun 2010 22:05:52 +0000 (15:05 -0700)
Current implementation always reports -1 when the file does not exist.
Fixing it to report actual error - usually ENOENT.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/lib/hgfsServer/hgfsServerLinux.c

index 7ee215427c966ac2c078bee8268f14daef163e3d..2375722248630ff5c25a58d54961ea8ee4e3066e 100644 (file)
@@ -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;
 }