summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2017-07-26 14:01:45 -0700
committerThiago Macieira <thiago.macieira@intel.com>2017-08-08 21:48:25 +0000
commite94830f496fbd266cd22284d0d114c31a96fdeea (patch)
treef3e36900e13ff9afb247810ea575011a446c250d /src/corelib
parent6504bc6bbc9276fe1a26c1af53c202371f334416 (diff)
QFileSystemEngine/Unix: support UF_HIDDEN on the other BSDs
The stat::st_flags and fchflags(2) syscall are marked: HISTORY The chflags() and fchflags functions first appeared in 4.4BSD. Change-Id: I81480fdb578d4d43b3fcfffd14d4fd23bd27e37e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Tobias C. Berner <tcberner@FreeBSD.org>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/io/qfilesystemengine_unix.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp
index 3047fc64f5..3bb20a2e00 100644
--- a/src/corelib/io/qfilesystemengine_unix.cpp
+++ b/src/corelib/io/qfilesystemengine_unix.cpp
@@ -464,7 +464,7 @@ void QFileSystemMetaData::fillFromStatBuf(const QT_STATBUF &statBuffer)
if (statBuffer.st_nlink == 0)
entryFlags |= QFileSystemMetaData::WasDeletedAttribute;
size_ = statBuffer.st_size;
-#if defined(Q_OS_DARWIN)
+#ifdef UF_HIDDEN
if (statBuffer.st_flags & UF_HIDDEN) {
entryFlags |= QFileSystemMetaData::HiddenAttribute;
knownFlagsMask |= QFileSystemMetaData::HiddenAttribute;
@@ -878,6 +878,8 @@ bool QFileSystemEngine::fillMetaData(const QFileSystemEntry &entry, QFileSystemM
if (!data.hasFlags(QFileSystemMetaData::DirectoryType))
what |= QFileSystemMetaData::DirectoryType;
}
+#endif
+#ifdef UF_HIDDEN
if (what & QFileSystemMetaData::HiddenAttribute) {
// OS X >= 10.5: st_flags & UF_HIDDEN
what |= QFileSystemMetaData::PosixStatFlags;