diff options
author | Mikhail Svetkin <mikhail.svetkin@qt.io> | 2018-03-20 14:27:45 +0100 |
---|---|---|
committer | Mikhail Svetkin <mikhail.svetkin@qt.io> | 2019-06-06 11:26:41 +0000 |
commit | d7093487a36b0b1a35c28d065f4f0a5890676216 (patch) | |
tree | 3d457070c056f6a5e7b882792aa6cc927d3cf917 | |
parent | b3c52e82245f46af9ce633a6de1e4e41fb9f3f6d (diff) |
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 <ryan.chu@qt.io>
-rw-r--r-- | src/corelib/io/io.pri | 2 | ||||
-rw-r--r-- | src/corelib/io/qlockfile_unix.cpp | 5 | ||||
-rw-r--r-- | 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 <sys/file.h> // flock #endif +#if defined(Q_OS_RTEMS) +# undef LOCK_EX +# undef LOCK_NB +#endif + #include <sys/types.h> // kill #include <signal.h> // kill #include <unistd.h> // 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 |