From 7d69d06b1aee6fe56740cbb032ef54460f819e9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Jim=C3=A9nez?= Date: Mon, 27 May 2013 18:35:27 +0200 Subject: [PATCH] Bug 874148 - crash in libxul.so!mozilla::hal_impl::GonkDiskSpaceWatcher::OnFileCanReadWithoutBlocking [GonkDiskSpaceWatcher.cpp : 238 + 0x4]. r=fabrice --- hal/gonk/GonkDiskSpaceWatcher.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hal/gonk/GonkDiskSpaceWatcher.cpp b/hal/gonk/GonkDiskSpaceWatcher.cpp index 52f8fa400e4e..d72480363b0c 100644 --- a/hal/gonk/GonkDiskSpaceWatcher.cpp +++ b/hal/gonk/GonkDiskSpaceWatcher.cpp @@ -232,8 +232,13 @@ GonkDiskSpaceWatcher::OnFileCanReadWithoutBlocking(int aFd) len = read(aFd, buf, sizeof(buf)); } while(len == -1 && errno == EINTR); + // Bail out if the file is busy. + if (len < 0 && errno == ETXTBSY) { + return; + } + // We should get an exact multiple of fanotify_event_metadata - if (len <= 0 || (len % sizeof(*fem) != 0)) { + if (len <= 0 || (len % FAN_EVENT_METADATA_LEN != 0)) { printf_stderr("About to crash: fanotify_event_metadata read error."); MOZ_CRASH(); }