summaryrefslogtreecommitdiffstats
path: root/src/proc_self_mountinfo.c
diff options
context:
space:
mode:
authorFederico Ceratto <federico.ceratto@gmail.com>2017-04-30 16:09:37 +0000
committerFederico Ceratto <federico.ceratto@gmail.com>2017-04-30 16:09:37 +0000
commit51f689a8e17ff3929acd2dbf39e936d2cd3ac723 (patch)
tree92e54f543171b69dcbc639be09d11221cf96ba28 /src/proc_self_mountinfo.c
parentNew upstream version 1.5.0+dfsg (diff)
downloadnetdata-51f689a8e17ff3929acd2dbf39e936d2cd3ac723.tar.xz
netdata-51f689a8e17ff3929acd2dbf39e936d2cd3ac723.zip
New upstream version 1.6.0+dfsgupstream/1.6.0+dfsg
Diffstat (limited to 'src/proc_self_mountinfo.c')
-rw-r--r--src/proc_self_mountinfo.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/proc_self_mountinfo.c b/src/proc_self_mountinfo.c
index d07f22510..bb031a9ab 100644
--- a/src/proc_self_mountinfo.c
+++ b/src/proc_self_mountinfo.c
@@ -175,10 +175,10 @@ static inline int is_read_only(const char *s) {
// read the whole mountinfo into a linked list
struct mountinfo *mountinfo_read(int do_statvfs) {
char filename[FILENAME_MAX + 1];
- snprintfz(filename, FILENAME_MAX, "%s/proc/self/mountinfo", global_host_prefix);
+ snprintfz(filename, FILENAME_MAX, "%s/proc/self/mountinfo", netdata_configured_host_prefix);
procfile *ff = procfile_open(filename, " \t", PROCFILE_FLAG_DEFAULT);
if(unlikely(!ff)) {
- snprintfz(filename, FILENAME_MAX, "%s/proc/1/mountinfo", global_host_prefix);
+ snprintfz(filename, FILENAME_MAX, "%s/proc/1/mountinfo", netdata_configured_host_prefix);
ff = procfile_open(filename, " \t", PROCFILE_FLAG_DEFAULT);
if(unlikely(!ff)) return NULL;
}
@@ -293,7 +293,7 @@ struct mountinfo *mountinfo_read(int do_statvfs) {
struct mountinfo *mt;
for(mt = root; mt; mt = mt->next) {
- if(unlikely(mt->st_dev == mi->st_dev && !(mi->flags & MOUNTINFO_NO_STAT))) {
+ if(unlikely(mt->st_dev == mi->st_dev && !(mt->flags & MOUNTINFO_IS_SAME_DEV))) {
if(strlen(mi->mount_point) < strlen(mt->mount_point))
mt->flags |= MOUNTINFO_IS_SAME_DEV;
else
@@ -319,7 +319,7 @@ struct mountinfo *mountinfo_read(int do_statvfs) {
}
// check if it has size
- if(do_statvfs) {
+ if(do_statvfs && !(mi->flags & MOUNTINFO_IS_DUMMY)) {
struct statvfs buff_statvfs;
if(unlikely(statvfs(mi->mount_point, &buff_statvfs) < 0)) {
mi->flags |= MOUNTINFO_NO_STAT;