diff options
author | Robert Nagy <robert@openbsd.org> | 2011-01-21 11:03:11 +0100 |
---|---|---|
committer | Robert Nagy <robert@openbsd.org> | 2011-01-21 11:03:11 +0100 |
commit | 1c321e027d5028864b871e2b44606adef905d469 (patch) | |
tree | 1755abab4c7f47a9b43ce516303b2f03467b67be /bridges | |
parent | fa14c14dc2ec7aab760190f95cd49b9021f04a6a (diff) |
use errno to get the correct error message if mkstemp() fails
Diffstat (limited to 'bridges')
-rw-r--r-- | bridges/source/cpp_uno/shared/vtablefactory.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bridges/source/cpp_uno/shared/vtablefactory.cxx b/bridges/source/cpp_uno/shared/vtablefactory.cxx index 1880b07c816e..4b819632c863 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; |