summaryrefslogtreecommitdiffstats
path: root/shlibs/mount
diff options
context:
space:
mode:
authorKarel Zak2011-04-27 17:17:16 +0200
committerKarel Zak2011-04-27 17:17:16 +0200
commit0983b5f7e67c23c553d7c14ac8d1788b1dc19890 (patch)
tree34bc64d782070609c4d98a3328a6c1acfb39bbce /shlibs/mount
parentlib: [tt.c] support fixed width and multiple tt_print_table() calls (diff)
downloadkernel-qcow2-util-linux-0983b5f7e67c23c553d7c14ac8d1788b1dc19890.tar.gz
kernel-qcow2-util-linux-0983b5f7e67c23c553d7c14ac8d1788b1dc19890.tar.xz
kernel-qcow2-util-linux-0983b5f7e67c23c553d7c14ac8d1788b1dc19890.zip
libmount: minor fix to mnt_tabdiff_*
- tabdiff has to support NULL fs->source - disable some debug messages Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs/mount')
-rw-r--r--shlibs/mount/src/cache.c6
-rw-r--r--shlibs/mount/src/tab.c1
-rw-r--r--shlibs/mount/src/tab_diff.c5
-rw-r--r--shlibs/mount/src/tab_parse.c6
4 files changed, 11 insertions, 7 deletions
diff --git a/shlibs/mount/src/cache.c b/shlibs/mount/src/cache.c
index 18b6cd49a..4775069c0 100644
--- a/shlibs/mount/src/cache.c
+++ b/shlibs/mount/src/cache.c
@@ -446,7 +446,7 @@ char *mnt_resolve_path(const char *path, struct libmnt_cache *cache)
assert(path);
- DBG(CACHE, mnt_debug_h(cache, "resolving path %s", path));
+ /*DBG(CACHE, mnt_debug_h(cache, "resolving path %s", path));*/
if (!path)
return NULL;
@@ -494,8 +494,8 @@ char *mnt_resolve_tag(const char *token, const char *value,
assert(token);
assert(value);
- DBG(CACHE, mnt_debug_h(cache, "resolving tag token=%s value=%s",
- token, value));
+ /*DBG(CACHE, mnt_debug_h(cache, "resolving tag token=%s value=%s",
+ token, value));*/
if (!token || !value)
return NULL;
diff --git a/shlibs/mount/src/tab.c b/shlibs/mount/src/tab.c
index 5c3c7994b..2a6a2355c 100644
--- a/shlibs/mount/src/tab.c
+++ b/shlibs/mount/src/tab.c
@@ -102,6 +102,7 @@ int mnt_reset_table(struct libmnt_table *tb)
mnt_free_fs(fs);
}
+ tb->nents = 0;
return 0;
}
diff --git a/shlibs/mount/src/tab_diff.c b/shlibs/mount/src/tab_diff.c
index 12b2f7742..d1a17bcb9 100644
--- a/shlibs/mount/src/tab_diff.c
+++ b/shlibs/mount/src/tab_diff.c
@@ -190,7 +190,6 @@ static struct tabdiff_entry *tabdiff_get_mount(struct libmnt_tabdiff *df,
struct list_head *p;
assert(df);
- assert(src);
list_for_each(p, &df->changes) {
struct tabdiff_entry *de;
@@ -202,7 +201,9 @@ static struct tabdiff_entry *tabdiff_get_mount(struct libmnt_tabdiff *df,
const char *s = mnt_fs_get_source(de->new_fs);
- if (s && strcmp(s, src) == 0)
+ if (s == NULL && src == NULL)
+ return de;
+ if (s && src && strcmp(s, src) == 0)
return de;
}
}
diff --git a/shlibs/mount/src/tab_parse.c b/shlibs/mount/src/tab_parse.c
index be85d4711..7419f3742 100644
--- a/shlibs/mount/src/tab_parse.c
+++ b/shlibs/mount/src/tab_parse.c
@@ -360,7 +360,8 @@ int mnt_table_parse_stream(struct libmnt_table *tb, FILE *f, const char *filenam
assert(f);
assert(filename);
- DBG(TAB, mnt_debug_h(tb, "%s: start parsing", filename));
+ DBG(TAB, mnt_debug_h(tb, "%s: start parsing (%d entries)",
+ filename, mnt_table_get_nents(tb)));
/* necessary for /proc/mounts only, the /proc/self/mountinfo
* parser sets the flag properly
@@ -389,7 +390,8 @@ int mnt_table_parse_stream(struct libmnt_table *tb, FILE *f, const char *filenam
}
}
- DBG(TAB, mnt_debug_h(tb, "%s: stop parsing", filename));
+ DBG(TAB, mnt_debug_h(tb, "%s: stop parsing (%d entries)",
+ filename, mnt_table_get_nents(tb)));
return 0;
err:
DBG(TAB, mnt_debug_h(tb, "%s: parse error (rc=%d)", filename, rc));