diff options
Diffstat (limited to 'src/corelib/ipc/qsharedmemory_posix.cpp')
-rw-r--r-- | src/corelib/ipc/qsharedmemory_posix.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/corelib/ipc/qsharedmemory_posix.cpp b/src/corelib/ipc/qsharedmemory_posix.cpp index 744a6d67a4..582c6628e1 100644 --- a/src/corelib/ipc/qsharedmemory_posix.cpp +++ b/src/corelib/ipc/qsharedmemory_posix.cpp @@ -10,6 +10,7 @@ #include <errno.h> +#if QT_CONFIG(sharedmemory) #if QT_CONFIG(posix_shm) #include <sys/types.h> #include <sys/mman.h> @@ -66,7 +67,7 @@ bool QSharedMemoryPosix::create(QSharedMemoryPrivate *self, qsizetype size) const QByteArray shmName = QFile::encodeName(self->nativeKey.nativeKey()); int fd; - EINTR_LOOP(fd, ::shm_open(shmName.constData(), O_RDWR | O_CREAT | O_EXCL | O_CLOEXEC, 0600)); + QT_EINTR_LOOP(fd, ::shm_open(shmName.constData(), O_RDWR | O_CREAT | O_EXCL | O_CLOEXEC, 0600)); if (fd == -1) { const int errorNumber = errno; const auto function = "QSharedMemory::attach (shm_open)"_L1; @@ -83,7 +84,7 @@ bool QSharedMemoryPosix::create(QSharedMemoryPrivate *self, qsizetype size) // the size may only be set once int ret; - EINTR_LOOP(ret, QT_FTRUNCATE(fd, size)); + QT_EINTR_LOOP(ret, QT_FTRUNCATE(fd, size)); if (ret == -1) { self->setUnixErrorString("QSharedMemory::create (ftruncate)"_L1); qt_safe_close(fd); @@ -102,7 +103,7 @@ bool QSharedMemoryPosix::attach(QSharedMemoryPrivate *self, QSharedMemory::Acces const int oflag = (mode == QSharedMemory::ReadOnly ? O_RDONLY : O_RDWR); const mode_t omode = (mode == QSharedMemory::ReadOnly ? 0400 : 0600); - EINTR_LOOP(hand, ::shm_open(shmName.constData(), oflag | O_CLOEXEC, omode)); + QT_EINTR_LOOP(hand, ::shm_open(shmName.constData(), oflag | O_CLOEXEC, omode)); if (hand == -1) { const int errorNumber = errno; const auto function = "QSharedMemory::attach (shm_open)"_L1; @@ -192,3 +193,4 @@ bool QSharedMemoryPosix::detach(QSharedMemoryPrivate *self) QT_END_NAMESPACE #endif // QT_CONFIG(posix_shm) +#endif // QT_CONFIG(sharedmemory) |