From d7093487a36b0b1a35c28d065f4f0a5890676216 Mon Sep 17 00:00:00 2001 From: Mikhail Svetkin Date: Tue, 20 Mar 2018 14:27:45 +0100 Subject: rtems: Disable fork feature and fix compilation in corelib/io RTEMS does not support fork. RTEMS has LOCK_EX and LOCK_NB defines but does not have flock. Change-Id: I2b1774435bc972f53596f4163ec410b9d22aca4a Reviewed-by: Ryan Chu --- src/corelib/io/io.pri | 2 +- src/corelib/io/qlockfile_unix.cpp | 5 +++++ src/corelib/io/qstorageinfo_unix.cpp | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/corelib/io/io.pri b/src/corelib/io/io.pri index 13b43ad8f7..fe81689932 100644 --- a/src/corelib/io/io.pri +++ b/src/corelib/io/io.pri @@ -172,7 +172,7 @@ win32 { io/qlockfile_unix.cpp \ io/qfilesystemiterator_unix.cpp - !integrity:!uikit { + !integrity:!uikit:!rtems { SOURCES += io/forkfd_qt.cpp HEADERS += \ ../3rdparty/forkfd/forkfd.h diff --git a/src/corelib/io/qlockfile_unix.cpp b/src/corelib/io/qlockfile_unix.cpp index 4a12157607..b2bf77c0da 100644 --- a/src/corelib/io/qlockfile_unix.cpp +++ b/src/corelib/io/qlockfile_unix.cpp @@ -58,6 +58,11 @@ #include // flock #endif +#if defined(Q_OS_RTEMS) +# undef LOCK_EX +# undef LOCK_NB +#endif + #include // kill #include // kill #include // gethostname diff --git a/src/corelib/io/qstorageinfo_unix.cpp b/src/corelib/io/qstorageinfo_unix.cpp index b7621b5d2f..d25a607d9f 100644 --- a/src/corelib/io/qstorageinfo_unix.cpp +++ b/src/corelib/io/qstorageinfo_unix.cpp @@ -812,7 +812,7 @@ void QStorageInfoPrivate::retrieveVolumeInfo() valid = true; ready = true; -#if defined(Q_OS_INTEGRITY) || (defined(Q_OS_BSD4) && !defined(Q_OS_NETBSD)) +#if defined(Q_OS_INTEGRITY) || (defined(Q_OS_BSD4) && !defined(Q_OS_NETBSD)) || defined(Q_OS_RTEMS) bytesTotal = statfs_buf.f_blocks * statfs_buf.f_bsize; bytesFree = statfs_buf.f_bfree * statfs_buf.f_bsize; bytesAvailable = statfs_buf.f_bavail * statfs_buf.f_bsize; @@ -822,7 +822,7 @@ void QStorageInfoPrivate::retrieveVolumeInfo() bytesAvailable = statfs_buf.f_bavail * statfs_buf.f_frsize; #endif blockSize = statfs_buf.f_bsize; -#if defined(Q_OS_ANDROID) || defined(Q_OS_BSD4) || defined(Q_OS_INTEGRITY) +#if defined(Q_OS_ANDROID) || defined(Q_OS_BSD4) || defined(Q_OS_INTEGRITY) || defined(Q_OS_RTEMS) #if defined(_STATFS_F_FLAGS) readOnly = (statfs_buf.f_flags & ST_RDONLY) != 0; #endif -- cgit v1.2.3