summaryrefslogtreecommitdiffstats
path: root/libmount/src/tab_parse.c
diff options
context:
space:
mode:
authorKarel Zak2011-10-01 15:33:53 +0200
committerKarel Zak2011-10-10 14:42:40 +0200
commit640fc1b8194e9d7f10302f19cba8d7671c8b1e9d (patch)
tree1a69507d841b94fd77a81c9912444ddf629bbaa9 /libmount/src/tab_parse.c
parentbuild-sys: rename BUILD_BUG_ON_ZERO definition (diff)
downloadkernel-qcow2-util-linux-640fc1b8194e9d7f10302f19cba8d7671c8b1e9d.tar.gz
kernel-qcow2-util-linux-640fc1b8194e9d7f10302f19cba8d7671c8b1e9d.tar.xz
kernel-qcow2-util-linux-640fc1b8194e9d7f10302f19cba8d7671c8b1e9d.zip
build-sys: check scanf %ms modifier
Without the check libmount builds on systems that has older than 2.7 glibc are silently unsuccessful. The missing %ms modifier will, at least, result on such system missing output of findmnt and lsblk commands. If either %ms or %as modifiers are present the libmount build is disabled. Based on patch from: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/tab_parse.c')
-rw-r--r--libmount/src/tab_parse.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/libmount/src/tab_parse.c b/libmount/src/tab_parse.c
index dba60028a..18a124345 100644
--- a/libmount/src/tab_parse.c
+++ b/libmount/src/tab_parse.c
@@ -54,11 +54,12 @@ static int mnt_parse_table_line(struct libmnt_fs *fs, char *s)
int rc, n = 0;
char *src, *fstype, *optstr;
- rc = sscanf(s, "%ms " /* (1) source */
- "%ms " /* (2) target */
- "%ms " /* (3) FS type */
- "%ms " /* (4) options */
- "%n", /* byte count */
+ rc = sscanf(s, UL_SCNsA" " /* (1) source */
+ UL_SCNsA" " /* (2) target */
+ UL_SCNsA" " /* (3) FS type */
+ UL_SCNsA" " /* (4) options */
+ "%n", /* byte count */
+
&src,
&fs->target,
&fstype,
@@ -114,9 +115,9 @@ static int mnt_parse_mountinfo_line(struct libmnt_fs *fs, char *s)
rc = sscanf(s, "%u " /* (1) id */
"%u " /* (2) parent */
"%u:%u " /* (3) maj:min */
- "%ms " /* (4) mountroot */
- "%ms " /* (5) target */
- "%ms" /* (6) vfs options (fs-independent) */
+ UL_SCNsA" " /* (4) mountroot */
+ UL_SCNsA" " /* (5) target */
+ UL_SCNsA /* (6) vfs options (fs-independent) */
"%n", /* number of read bytes */
&fs->id,
@@ -138,9 +139,9 @@ static int mnt_parse_mountinfo_line(struct libmnt_fs *fs, char *s)
}
s = p + 3;
- rc += sscanf(s, "%ms " /* (8) FS type */
- "%ms " /* (9) source */
- "%ms", /* (10) fs options (fs specific) */
+ rc += sscanf(s, UL_SCNsA" " /* (8) FS type */
+ UL_SCNsA" " /* (9) source */
+ UL_SCNsA, /* (10) fs options (fs specific) */
&fstype,
&src,