summaryrefslogtreecommitdiff
path: root/src/df.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/df.c')
-rw-r--r--src/df.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/df.c b/src/df.c
index 24897a33f..a7fc57ff7 100644
--- a/src/df.c
+++ b/src/df.c
@@ -853,6 +853,11 @@ get_dev (char const *disk, char const *mount_point, char const* file,
if (!selected_fstype (fstype) || excluded_fstype (fstype))
return;
+ /* Ignore relative MOUNT_POINTs, which are present for example
+ in /proc/mounts on Linux with network namespaces. */
+ if (!force_fsu && mount_point && ! IS_ABSOLUTE_FILE_NAME (mount_point))
+ return;
+
/* If MOUNT_POINT is NULL, then the file system is not mounted, and this
program reports on the file system that the special file is on.
It would be better to report on the unmounted file system,