diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2010-01-16 08:21:15 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-01-17 01:53:09 -0500 |
commit | 69e3f52d1b1a3ed4390bb8a09bb1324265af7fbf (patch) | |
tree | 33f9f9c20674efe68b7127e28cf2b456bf0cdfac | |
parent | d6f962b57bfaab62891c7abbf1469212a56d6103 (diff) |
perf: Fix implicit declaration of getline in util.c
getline() is considered as undeclared in util/util.c because
it includes string.h, that in turn includes stdio.h, without
having defined _GNU_SOURCE.
But util.c also includes util.h that handles the _GNU_SOURCE and
all the needed inclusions already. Let's include only util.h
and sys/mman.h which is the only one header not handled by
util.h
This fixes the following build error:
util/util.c: In function 'slow_copyfile':
util/util.c:49: erreur: implicit declaration of function
'getline' util/util.c:49: erreur: nested extern declaration of 'getline'
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1263648075-3858-1-git-send-regression-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | tools/perf/util/util.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c index f0685849b244..f9b890fde681 100644 --- a/tools/perf/util/util.c +++ b/tools/perf/util/util.c | |||
@@ -1,10 +1,5 @@ | |||
1 | #include <sys/mman.h> | ||
2 | #include <sys/stat.h> | ||
3 | #include <sys/types.h> | ||
4 | #include <fcntl.h> | ||
5 | #include <string.h> | ||
6 | #include <unistd.h> | ||
7 | #include "util.h" | 1 | #include "util.h" |
2 | #include <sys/mman.h> | ||
8 | 3 | ||
9 | int mkdir_p(char *path, mode_t mode) | 4 | int mkdir_p(char *path, mode_t mode) |
10 | { | 5 | { |