[PATCH] btrfs-progs: Check /etc/mtab in check_mounted()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Pekka Enberg <penberg@xxxxxxxxxxxxxx>

The setmntent() lookup for '/proc/mounts' returns NULL on Ubuntu so use
'/etc/mtab' instead.

Signed-off-by: Pekka Enberg <penberg@xxxxxxxxxxxxxx>
---
 utils.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/utils.c b/utils.c
index 2f4c6e1..af1c6ec 100644
--- a/utils.c
+++ b/utils.c
@@ -600,7 +600,7 @@ int check_mounted(char *file)
 	FILE *f;
 	int ret = 0;
 
-	if ((f = setmntent ("/proc/mounts", "r")) == NULL)
+	if ((f = setmntent ("/etc/mtab", "r")) == NULL)
 		return -errno;
 
 	if (stat(file, &st_buf) < 0) {
-- 
1.5.6.3



--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux