Blame SOURCES/ovt-Fix-two-coverity-issues-reported-by-a-customer.patch

604589
From 86ec5be96b61f3b391711aab3aee0c4d85101b2f Mon Sep 17 00:00:00 2001
604589
From: Cathy Avery <cavery@redhat.com>
604589
Date: Thu, 25 Jul 2019 12:32:39 +0200
604589
Subject: [PATCH 16/16] Fix two coverity issues reported by a customer.
604589
604589
RH-Author: Cathy Avery <cavery@redhat.com>
604589
Message-id: <20190725123239.18274-17-cavery@redhat.com>
604589
Patchwork-id: 89719
604589
O-Subject: [RHEL8.1 open-vm-tools PATCH 16/16] [Tools/dndcp] Fix two coverity issues reported by a customer.
604589
Bugzilla: 1602648
604589
RH-Acked-by: Vitaly Kuznetsov <vkuznets@redhat.com>
604589
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
604589
604589
commit 04813113e28f6cfecf956166136bbad2a6c2a386
604589
Author: Oliver Kurth <okurth@vmware.com>
604589
Date:   Sat Jul 20 17:15:19 2019 -0700
604589
604589
    [Tools/dndcp] Fix two coverity issues reported by a customer.
604589
604589
Signed-off-by: Cathy Avery <cavery@redhat.com>
604589
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
604589
---
604589
 open-vm-tools/services/plugins/dndcp/copyPasteUIX11.cpp | 14 +++++++++++---
604589
 1 file changed, 11 insertions(+), 3 deletions(-)
604589
604589
diff --git a/services/plugins/dndcp/copyPasteUIX11.cpp b/services/plugins/dndcp/copyPasteUIX11.cpp
604589
index 6c40b84..e9b9e26 100644
604589
--- a/services/plugins/dndcp/copyPasteUIX11.cpp
604589
+++ b/services/plugins/dndcp/copyPasteUIX11.cpp
604589
@@ -1664,10 +1664,11 @@ CopyPasteUIX11::FileBlockMonitorThread(void *arg)   // IN
604589
       }
604589
 
604589
       int fd = open(params->fileBlockName.c_str(), O_RDONLY);
604589
-      if (fd <= 0) {
604589
-         g_debug("%s: Failed to open %s\n",
604589
+      if (fd < 0) {
604589
+         g_debug("%s: Failed to open %s, errno is %d\n",
604589
                  __FUNCTION__,
604589
-                 params->fileBlockName.c_str());
604589
+                 params->fileBlockName.c_str(),
604589
+                 errno);
604589
          continue;
604589
       }
604589
 
604589
@@ -1688,6 +1689,13 @@ CopyPasteUIX11::FileBlockMonitorThread(void *arg)   // IN
604589
       } else {
604589
          g_debug("%s: Block is not added\n", __FUNCTION__);
604589
       }
604589
+
604589
+      if (close(fd) < 0) {
604589
+         g_debug("%s: Failed to close %s, errno is %d\n",
604589
+                 __FUNCTION__,
604589
+                 params->fileBlockName.c_str(),
604589
+                 errno);
604589
+      }
604589
    }
604589
    pthread_mutex_unlock(&params->fileBlockMutex);
604589
    return NULL;
604589
-- 
604589
1.8.3.1
604589