History

perf tools: Fix statfs.f_type data type mismatch build error with uclibc

ARC Linux uses the no legacy syscalls abi and corresponding uClibc headers statfs defines f_type to be U32 which causes perf build breakage http://git.uclibc.org/uClibc/tree/libc/sysdeps/linux/common-generic/bits/statfs.h ----------->8--------------- CC fs/fs.o fs/fs.c: In function 'fs__valid_mount': fs/fs.c:82:24: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] else if (st_fs.f_type != magic) ^ cc1: all warnings being treated as errors ----------->8---------------

Alexey Brodkin committed 11 years ago

Commit db1806e1 parent 25cd4802 files · +2 −2Browse files

Unified · Split

2 files
  1. tools/lib/api/fs/debugfs.c +1 −1
  2. tools/lib/api/fs/fs.c +1 −1
tools/lib/api/fs/debugfs.c+1−1
@@ -67,7 +67,7 @@ int debugfs_valid_mountpoint(const char *debugfs) · 66 unmodified lines
67 67
68 if (statfs(debugfs, &st_fs) < 0)68 if (statfs(debugfs, &st_fs) < 0)
69 return -ENOENT;69 return -ENOENT;
70 else if (st_fs.f_type != (long) DEBUGFS_MAGIC)70 else if ((long)st_fs.f_type != (long)DEBUGFS_MAGIC)
71 return -ENOENT;71 return -ENOENT;
72 72
73 return 0;73 return 0;
tools/lib/api/fs/fs.c+1−1
@@ -79,7 +79,7 @@ static int fs__valid_mount(const char *fs, long magic) · 78 unmodified lines
79 79
80 if (statfs(fs, &st_fs) < 0)80 if (statfs(fs, &st_fs) < 0)
81 return -ENOENT;81 return -ENOENT;
82 else if (st_fs.f_type != magic)82 else if ((long)st_fs.f_type != magic)
83 return -ENOENT;83 return -ENOENT;
84 84
85 return 0;85 return 0;