diff options
-rw-r--r-- | src/corelib/io/qtemporarydir.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/corelib/io/qtemporarydir.cpp b/src/corelib/io/qtemporarydir.cpp index 32c3d92dca..c7150d7b33 100644 --- a/src/corelib/io/qtemporarydir.cpp +++ b/src/corelib/io/qtemporarydir.cpp @@ -135,6 +135,15 @@ QPair<QString, bool> q_mkdtemp(char *templateName) } return qMakePair(QFile::decodeName(templateName), true); } +# ifdef Q_OS_WIN + const int exists = ERROR_ALREADY_EXISTS; + int code = GetLastError(); +# else + const int exists = EEXIST; + int code = errno; +# endif + if (code != exists) + return qMakePair(qt_error_string(code), false); } return qMakePair(qt_error_string(), false); } |