[PATCH] perf: Fix implicit declaration of getline in util.c

From: Frederic Weisbecker
Date: Sat Jan 16 2010 - 08:21:27 EST


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@xxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Cc: Paul Mackerras <paulus@xxxxxxxxx>
---
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 f068584..f9b890f 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -1,10 +1,5 @@
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <string.h>
-#include <unistd.h>
#include "util.h"
+#include <sys/mman.h>

int mkdir_p(char *path, mode_t mode)
{
--
1.6.2.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/