summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Arnhold <thomas@arnhold.org>2011-01-28 23:45:51 +0100
committerThomas Arnhold <thomas@arnhold.org>2011-01-29 15:39:11 +0100
commite02d516c739ce70aff7b4a1469cad7a63ab0dc98 (patch)
treec81c23dc2f1351140eb3738d66287044bf635234
parent9b94be0be22fb748834d00740bb964804bdef518 (diff)
Use errno to get the correct error message if mkstemp() fails.
-rw-r--r--idlc/source/idlccompile.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/idlc/source/idlccompile.cxx b/idlc/source/idlccompile.cxx
index 8453a3e8b..b336c6243 100644
--- a/idlc/source/idlccompile.cxx
+++ b/idlc/source/idlccompile.cxx
@@ -41,6 +41,7 @@
#endif
#ifdef SAL_UNX
+#include <errno.h>
#include <unistd.h>
#if defined(MACOSX) || defined(FREEBSD) || defined(NETBSD) || \
defined(AIX) || defined(OPENBSD)
@@ -168,7 +169,7 @@ OString makeTempName(const OString& prefix)
int nDescriptor = mkstemp(tmpFilePattern);
if( -1 == nDescriptor )
{
- fprintf( stderr,"idlc: couldn't create temporary file\n" );
+ fprintf(stderr, "idlc: mkstemp(\"%s\") failed: %s\n", tmpFilePattern, strerror(errno));
exit( 1 );
}
// the file shall later be reopened by stdio functions