diff options
author | Ondrej Oprala | 2013-01-10 12:35:08 +0100 |
---|---|---|
committer | Karel Zak | 2013-01-10 14:52:24 +0100 |
commit | e47a19312ff91de3c4ead99714b8bfa06139809e (patch) | |
tree | 10af2946745dab0416cc97e74c5c4ce0c2b8bf90 /libmount/src/tab_parse.c | |
parent | libmount: fix regression test helper (diff) | |
download | kernel-qcow2-util-linux-e47a19312ff91de3c4ead99714b8bfa06139809e.tar.gz kernel-qcow2-util-linux-e47a19312ff91de3c4ead99714b8bfa06139809e.tar.xz kernel-qcow2-util-linux-e47a19312ff91de3c4ead99714b8bfa06139809e.zip |
libmount: read optional mountinfo fields
[kzak@redhat.com: - rename struct member and functions from
"propagation" to "optional fields"
- split the original patch
- fix parser]
Signed-off-by: Ondrej Oprala <ondrej.oprala@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/tab_parse.c')
-rw-r--r-- | libmount/src/tab_parse.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libmount/src/tab_parse.c b/libmount/src/tab_parse.c index 56da8ec47..a8b7b79d4 100644 --- a/libmount/src/tab_parse.c +++ b/libmount/src/tab_parse.c @@ -161,6 +161,8 @@ static int mnt_parse_mountinfo_line(struct libmnt_fs *fs, char *s) DBG(TAB, mnt_debug("mountinfo parse error: not found separator")); return -EINVAL; } + if (p > s + 1) + fs->opt_fields = strndup(s + 1, p - s - 1); s = p + 3; rc += sscanf(s, UL_SCNsA" " /* (8) FS type */ |