From ba7232a1fe1398e7947d1af39fadc8d02b21bf69 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 12 Mar 2010 23:42:56 +0100 Subject: libmount: add mnt_cache_find_tag_value() Signed-off-by: Karel Zak --- shlibs/mount/src/tab.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'shlibs/mount/src/tab.c') diff --git a/shlibs/mount/src/tab.c b/shlibs/mount/src/tab.c index 98c56602b..176a7d5a7 100644 --- a/shlibs/mount/src/tab.c +++ b/shlibs/mount/src/tab.c @@ -519,9 +519,11 @@ mnt_fs *mnt_tab_find_srcpath(mnt_tab *tb, const char *path, int direction) /* evaluated tag */ if (ntags) { + int rc = mnt_cache_read_tags(tb->cache, cn); + mnt_reset_iter(&itr, direction); - if (mnt_cache_read_tags(tb->cache, cn) > 0) { + if (rc == 0) { /* @path's TAGs are in the cache */ while(mnt_tab_next_fs(tb, &itr, &fs) == 0) { const char *t, *v; @@ -532,7 +534,7 @@ mnt_fs *mnt_tab_find_srcpath(mnt_tab *tb, const char *path, int direction) if (mnt_cache_device_has_tag(tb->cache, cn, t, v)) return fs; } - } else if (errno == EACCES) { + } else if (rc < 0 && errno == EACCES) { /* @path is unaccessible, try evaluate all TAGs in @tb * by udev symlinks -- this could be expensive on systems * with huge fstab/mtab */ -- cgit v1.2.3-55-g7522