All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs-progs: Check /etc/mtab in check_mounted()
@ 2009-07-23 18:11 Pekka Enberg
  0 siblings, 0 replies; only message in thread
From: Pekka Enberg @ 2009-07-23 18:11 UTC (permalink / raw)
  To: chris.mason; +Cc: linux-btrfs

From: Pekka Enberg <penberg@cs.helsinki.fi>

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

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
---
 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




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-07-23 18:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-23 18:11 [PATCH] btrfs-progs: Check /etc/mtab in check_mounted() Pekka Enberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.