about summary refs log tree commit diff
path: root/lr.c
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2015-10-27 21:58:55 +0100
committerChristian Neukirchen <chneukirchen@gmail.com>2015-10-27 21:58:55 +0100
commitb48a24ea354d530694865691a60a71fae5b0373c (patch)
treed75ec3cc954645521b1c92383c5a24dfa02b2c15 /lr.c
parent10aa32318c194c2fb435c262c7965da53f6b652c (diff)
downloadlr-b48a24ea354d530694865691a60a71fae5b0373c.tar.gz
lr-b48a24ea354d530694865691a60a71fae5b0373c.tar.xz
lr-b48a24ea354d530694865691a60a71fae5b0373c.zip
don't hardcode paths
Diffstat (limited to 'lr.c')
-rw-r--r--lr.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lr.c b/lr.c
index 816357e..1463aee 100644
--- a/lr.c
+++ b/lr.c
@@ -41,6 +41,7 @@
 #include <fnmatch.h>
 #include <grp.h>
 #include <limits.h>
+#include <paths.h>
 #include <pwd.h>
 #include <regex.h>
 #include <search.h>
@@ -665,7 +666,7 @@ scan_filesystems()
 	/* Approach: iterate over mtab and memorize st_dev for each mountpoint.
 	 * this will fail if we are not allowed to read the mountpoint, but then
 	 * we should not have to look up this st_dev value... */
-	mtab = setmntent("/etc/mtab", "r");
+	mtab = setmntent(_PATH_MOUNTED, "r");
 	if (!mtab)
 		return;
 
@@ -692,7 +693,7 @@ scan_filesystems()
 	struct mnttab mnt;
 	struct stat st;
 
-	mtab = fopen("/etc/mnttab", "r");
+	mtab = fopen(MNTTAB, "r");
 	if (!mtab)
 		return;