summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimeon Bird <bladud@gmail.com>2012-08-18 20:14:32 (GMT)
committerSimeon Bird <bladud@gmail.com>2012-08-21 03:59:20 (GMT)
commit55761d35bb9e9ce863797b742c301d947dab61d0 (patch)
tree20e08c85b507a81f6a30071200721eba75dc8e7f
parent5609c4cdd8c7d938a9b3e99285b1044eea2fcf04 (diff)
Check for inotify on kernels that have a two-number version string, like 3.0
-rw-r--r--services/filewatch/kinotify.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/services/filewatch/kinotify.cpp b/services/filewatch/kinotify.cpp
index 454a0c5..260ac4b 100644
--- a/services/filewatch/kinotify.cpp
+++ b/services/filewatch/kinotify.cpp
@@ -200,12 +200,14 @@ bool KInotify::available() const
if( d->inotify() > 0 ) {
// trueg: Copied from KDirWatch.
struct utsname uts;
- int major, minor, patch;
+ int major, minor, patch=0;
if ( uname(&uts) < 0 ) {
return false; // *shrug*
}
else if ( sscanf( uts.release, "%d.%d.%d", &major, &minor, &patch) != 3 ) {
- return false; // *shrug*
+ //Kernels > 3.0 can in principle have two-number versions.
+ if ( sscanf( uts.release, "%d.%d", &major, &minor) != 2 )
+ return false; // *shrug*
}
else if( major * 1000000 + minor * 1000 + patch < 2006014 ) { // <2.6.14
kDebug(7001) << "Can't use INotify, Linux kernel too old";