Bug 1086987 - MOZ_CRASH if there is no fanotify support, r=dhylands
authorMichael Wu <mwu@mozilla.com>
Tue, 28 Oct 2014 12:32:11 -0400
changeset 224055 74a74122337fc18a22a680f40c5b7f34548f74f2
parent 224054 de8277c450f2accfc1245b5d5f40d1398e272254
child 224056 b4225acf7777b61b6ddf13f134a994f215ed3d37
push id6
push usergszorc@mozilla.com
push dateWed, 29 Oct 2014 17:51:36 +0000
reviewersdhylands
bugs1086987
milestone36.0a1
Bug 1086987 - MOZ_CRASH if there is no fanotify support, r=dhylands
hal/gonk/GonkDiskSpaceWatcher.cpp
--- a/hal/gonk/GonkDiskSpaceWatcher.cpp
+++ b/hal/gonk/GonkDiskSpaceWatcher.cpp
@@ -164,16 +164,19 @@ GonkDiskSpaceWatcher::DoStart()
   NS_ASSERTION(XRE_GetIOMessageLoop() == MessageLoopForIO::current(),
                "Not on the correct message loop");
 
   mFd = fanotify_init(FAN_CLASS_NOTIF, FAN_CLOEXEC);
   if (mFd == -1) {
     NS_WARNING("Error calling inotify_init()");
     if (errno == ENOSYS) {
       NS_WARNING("Warning: No fanotify support in this device's kernel.\n");
+#if ANDROID_VERSION >= 19
+      MOZ_CRASH("Fanotify support must be enabled in the kernel.");
+#endif
     }
     return;
   }
 
   if (fanotify_mark(mFd, FAN_MARK_ADD | FAN_MARK_MOUNT, FAN_CLOSE,
                     0, kWatchedPath) < 0) {
     NS_WARNING("Error calling fanotify_mark");
     close(mFd);