[Libreoffice-commits] core.git: sal/osl

Stephan Bergmann sbergman at redhat.com
Thu Mar 6 05:46:59 PST 2014


 sal/osl/unx/profile.cxx |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 535b1dadc202ecb65510e846fe21652a84f3c07d
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Mar 6 14:46:29 2014 +0100

    coverity#1190345 log failure to set CLOEXEC flag
    
    Change-Id: Ia1678200393db0165711d4027f92a8be6b7f4ca5

diff --git a/sal/osl/unx/profile.cxx b/sal/osl/unx/profile.cxx
index 952e5e2..402bf9c 100644
--- a/sal/osl/unx/profile.cxx
+++ b/sal/osl/unx/profile.cxx
@@ -25,6 +25,7 @@
 #include <osl/process.h>
 #include <osl/thread.h>
 #include <rtl/alloc.h>
+#include <sal/log.hxx>
 
 #define LINES_INI       32
 #define LINES_ADD       10
@@ -1221,7 +1222,10 @@ static osl_TFile* openFileImpl(const sal_Char* pszFilename, oslProfileOption Pro
     if ((Flags = fcntl(pFile->m_Handle, F_GETFD, 0)) != -1)
     {
         Flags |= FD_CLOEXEC;
-        fcntl(pFile->m_Handle, F_SETFD, Flags);
+        int e = fcntl(pFile->m_Handle, F_SETFD, Flags);
+        SAL_INFO_IF(
+            e != 0, "sal.osl",
+            "fcntl to set FD_CLOEXEC failed for " << pszFilename);
     }
 
     pFile->m_pWriteBuf=0;


More information about the Libreoffice-commits mailing list