]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Use proper function to translate system error into a vix error.
authorVMware, Inc <>
Thu, 18 Nov 2010 22:11:20 +0000 (14:11 -0800)
committerMarcelo Vanzin <mvanzin@vmware.com>
Thu, 18 Nov 2010 22:11:20 +0000 (14:11 -0800)
Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/services/plugins/vix/vixTools.c

index 77529f277b3dcf84b65dfbf3833d461e2893824b..a4aa45544e86a3706787eb2b9cf79b5a7f8ad2d9 100644 (file)
@@ -5886,7 +5886,13 @@ if (0 == *interpreterName) {
       }
    }
    if (fd < 0) {
-      err = FoundryToolsDaemon_TranslateSystemErr();
+      /*
+       * We use Posix variant function i.e. Posix_Open to create a
+       * temporary file. If Posix_Open() fails, then proper error is
+       * stuffed in errno variable. So, use Vix_TranslateErrno()
+       * to translate the errno to a proper foundry error.
+       */
+      err = Vix_TranslateErrno(errno);
       Debug("Unable to create a temporary file, errno is %d.\n", errno);
       goto abort;
    }
@@ -5903,7 +5909,7 @@ if (0 == *interpreterName) {
        * close(), but if close() succeeds it will clobber the errno, causing
        * something confusing to be reported to the user.
        */
-      err = FoundryToolsDaemon_TranslateSystemErr();
+      err = Vix_TranslateErrno(errno);
       Debug("Unable to write the script to the temporary file, errno is %d.\n", errno);
       if (close(fd) < 0) {
          Debug("Unable to close a file, errno is %d\n", errno);
@@ -5921,7 +5927,7 @@ if (0 == *interpreterName) {
        *     checking the return value when closing the file may lead to silent loss
        *     of data.  This can especially be observed with NFS and disk quotas."
        */
-      err = FoundryToolsDaemon_TranslateSystemErr();
+      err = Vix_TranslateErrno(errno);
       Debug("Unable to close a file, errno is %d\n", errno);
       goto abort;
    }