Changeset View
Changeset View
Standalone View
Standalone View
src/lib/io/kdirwatch.cpp
Show First 20 Lines • Show All 937 Lines • ▼ Show 20 Line(s) | 934 | { | |||
---|---|---|---|---|---|
938 | 938 | | |||
939 | // This allows to configure a different method for NFS mounts, since inotify | 939 | // This allows to configure a different method for NFS mounts, since inotify | ||
940 | // cannot detect changes made by other machines. However as a default inotify | 940 | // cannot detect changes made by other machines. However as a default inotify | ||
941 | // is fine, since the most common case is a NFS-mounted home, where all changes | 941 | // is fine, since the most common case is a NFS-mounted home, where all changes | ||
942 | // are made locally. #177892. | 942 | // are made locally. #177892. | ||
943 | KDirWatch::Method preferredMethod = m_preferredMethod; | 943 | KDirWatch::Method preferredMethod = m_preferredMethod; | ||
944 | if (m_nfsPreferredMethod != m_preferredMethod) { | 944 | if (m_nfsPreferredMethod != m_preferredMethod) { | ||
945 | if (KFileSystemType::fileSystemType(e->path) == KFileSystemType::Nfs) { | 945 | if (KFileSystemType::fileSystemType(e->path) == KFileSystemType::Nfs) { | ||
946 | preferredMethod = m_nfsPreferredMethod; | 946 | preferredMethod = m_nfsPreferredMethod; | ||
bruns: m_nfsPreferredMethod defaults to `KDirWatch::FAM`, i.e. it will crash below now on NFS when FAM… | |||||
meven: So either change the default, or add a Q_FALLTHROUH() ? | |||||
947 | } | 947 | } | ||
948 | } | 948 | } | ||
949 | 949 | | |||
950 | // Try the appropriate preferred method from the config first | 950 | // Try the appropriate preferred method from the config first | ||
951 | bool entryAdded = false; | 951 | bool entryAdded = false; | ||
952 | switch (preferredMethod) { | 952 | switch (preferredMethod) { | ||
953 | #if HAVE_FAM | 953 | #if HAVE_FAM | ||
954 | case KDirWatch::FAM: entryAdded = useFAM(e); break; | 954 | case KDirWatch::FAM: entryAdded = useFAM(e); break; | ||
955 | #else | ||||
956 | case KDirWatch::FAM: Q_UNREACHABLE(); break; | ||||
955 | #endif | 957 | #endif | ||
956 | #if HAVE_SYS_INOTIFY_H | 958 | #if HAVE_SYS_INOTIFY_H | ||
957 | case KDirWatch::INotify: entryAdded = useINotify(e); break; | 959 | case KDirWatch::INotify: entryAdded = useINotify(e); break; | ||
958 | #endif | 960 | #endif | ||
959 | #if HAVE_QFILESYSTEMWATCHER | 961 | #if HAVE_QFILESYSTEMWATCHER | ||
960 | case KDirWatch::QFSWatch: entryAdded = useQFSWatch(e); break; | 962 | case KDirWatch::QFSWatch: entryAdded = useQFSWatch(e); break; | ||
961 | #endif | 963 | #endif | ||
962 | case KDirWatch::Stat: entryAdded = useStat(e); break; | 964 | case KDirWatch::Stat: entryAdded = useStat(e); break; | ||
▲ Show 20 Lines • Show All 1089 Lines • Show Last 20 Lines |
m_nfsPreferredMethod defaults to KDirWatch::FAM, i.e. it will crash below now on NFS when FAM is disabled.