diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2009-04-22 15:30:51 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-07-02 11:29:35 (GMT) |
commit | 29302d2429ed81f4396155383b602e7bde4edd3b (patch) | |
tree | 434cccb049b37e0659fbc8d312bed3eaa9fc943d /src/corelib/kernel | |
parent | c5f83fbd89d6bb950fb012c285879f6c88b5bdf3 (diff) | |
download | Qt-29302d2429ed81f4396155383b602e7bde4edd3b.zip Qt-29302d2429ed81f4396155383b602e7bde4edd3b.tar.gz Qt-29302d2429ed81f4396155383b602e7bde4edd3b.tar.bz2 |
Port most uses of ::open and QT_OPEN to the safe version.
This ensures that we're calling the open64 version of this function as
well as handling the O_CLOEXEC flag and EINTR errors.
Reviewed-By: João Abecasis
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r-- | src/corelib/kernel/qsharedmemory_unix.cpp | 4 | ||||
-rw-r--r-- | src/corelib/kernel/qtranslator.cpp | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/corelib/kernel/qsharedmemory_unix.cpp b/src/corelib/kernel/qsharedmemory_unix.cpp index 5299972..04739ff 100644 --- a/src/corelib/kernel/qsharedmemory_unix.cpp +++ b/src/corelib/kernel/qsharedmemory_unix.cpp @@ -59,6 +59,8 @@ #include <fcntl.h> #include <unistd.h> +#include "private/qcore_unix_p.h" + QT_BEGIN_NAMESPACE QSharedMemoryPrivate::QSharedMemoryPrivate() @@ -153,7 +155,7 @@ int QSharedMemoryPrivate::createUnixKeyFile(const QString &fileName) if (QFile::exists(fileName)) return 0; - int fd = open(QFile::encodeName(fileName).constData(), + int fd = qt_safe_open(QFile::encodeName(fileName).constData(), O_EXCL | O_CREAT | O_RDWR, 0640); if (-1 == fd) { if (errno == EEXIST) diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp index 64cf16e..4aed2b2 100644 --- a/src/corelib/kernel/qtranslator.cpp +++ b/src/corelib/kernel/qtranslator.cpp @@ -58,6 +58,7 @@ #if defined(Q_OS_UNIX) #define QT_USE_MMAP +#include "private/qcore_unix_p.h" #endif // most of the headers below are already included in qplatformdefs.h |