[platform] makes fsnotifier look for '/proc/mounts' if '/etc/mtab' is missing (IDEA-198080)

This commit is contained in:
Roman Shevchenko
2018-12-17 19:13:21 +01:00
parent 6f7e4784f3
commit 4ef969cc1a
4 changed files with 4 additions and 1 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -16,7 +16,7 @@
#pragma once
#define VERSION "20160218.1348"
#define VERSION "20181217.1910"
#include <stdbool.h>
#include <stdio.h>

View File

@@ -411,6 +411,9 @@ static bool is_watchable(const char* fs) {
static array* unwatchable_mounts() {
FILE* mtab = setmntent(_PATH_MOUNTED, "r");
if (mtab == NULL && errno == ENOENT) {
mtab = setmntent("/proc/mounts", "r");
}
if (mtab == NULL) {
userlog(LOG_ERR, "cannot open " _PATH_MOUNTED);
return NULL;