[Libreoffice-commits] .: bridges/source

Robert Nagy rnagy at kemper.freedesktop.org
Fri Jan 21 02:03:40 PST 2011


 bridges/source/cpp_uno/shared/vtablefactory.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 9160dfc191d4b2496f55ccba663815c08db4ba1b
Author: Robert Nagy <robert at openbsd.org>
Date:   Fri Jan 21 11:03:11 2011 +0100

    use errno to get the correct error message if mkstemp() fails

diff --git a/bridges/source/cpp_uno/shared/vtablefactory.cxx b/bridges/source/cpp_uno/shared/vtablefactory.cxx
index bc933a7..777d0da 100644
--- a/bridges/source/cpp_uno/shared/vtablefactory.cxx
+++ b/bridges/source/cpp_uno/shared/vtablefactory.cxx
@@ -57,6 +57,7 @@
 #if defined SAL_UNX
 #include <unistd.h>
 #include <string.h>
+#include <errno.h>
 #include <sys/mman.h>
 #elif defined SAL_W32
 #define WIN32_LEAN_AND_MEAN
@@ -270,7 +271,7 @@ bool VtableFactory::createBlock(Block &block, sal_Int32 slotCount) const
         char *tmpfname = new char[aTmpName.getLength()+1];
         strncpy(tmpfname, aTmpName.getStr(), aTmpName.getLength()+1);
         if ((block.fd = mkstemp(tmpfname)) == -1)
-            perror("creation of executable memory area failed");
+            fprintf(stderr, "mkstemp(\"%s\") failed: %s\n", tmpfname, strerror(errno));
         if (block.fd == -1)
         {
             delete[] tmpfname;


More information about the Libreoffice-commits mailing list