summaryrefslogtreecommitdiff
path: root/inotail.c
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2007-09-18 13:37:46 +0200
committerTobias Klauser <tklauser@xenon.tklauser.home>2007-09-18 13:37:46 +0200
commit6b1ce4b2a1eb356541bbc5ed661344b30f7bab85 (patch)
tree160690f04fd3031b34e798e418a7751eab94800b /inotail.c
parent8787c5e9f422ae6a9d3e3f5445301f753c3fe02d (diff)
intotail.c: Check for n_units == 0 before calling tail_pipe_*()
Diffstat (limited to 'inotail.c')
-rw-r--r--inotail.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/inotail.c b/inotail.c
index cd96ec1..c455fd0 100644
--- a/inotail.c
+++ b/inotail.c
@@ -247,9 +247,6 @@ static ssize_t tail_pipe_lines(struct file_struct *f, unsigned long n_lines)
unsigned long total_lines = 0;
const char *p;
- if (n_lines == 0)
- return 0;
-
first = last = emalloc(sizeof(struct line_buf));
first->n_bytes = first->n_lines = 0;
first->next = NULL;
@@ -352,9 +349,6 @@ static ssize_t tail_pipe_bytes(struct file_struct *f, unsigned long n_bytes)
unsigned long total_bytes = 0;
unsigned long i = 0; /* Index into buffer */
- if (n_bytes == 0)
- return 0;
-
first = last = emalloc(sizeof(struct char_buf));
first->n_bytes = 0;
first->next = NULL;
@@ -461,6 +455,9 @@ static int tail_file(struct file_struct *f, unsigned long n_units, char mode, ch
if (verbose)
write_header(f->name);
+ if (n_units == 0)
+ return 0;
+
if (mode == M_LINES)
return tail_pipe_lines(f, n_units);
else
e/eranian/perfmon/official/tip/build/tools/perf/perf record date # event : name = cycles, type = 0, config = 0x0, config1 = 0x0, config2 = 0x0, excl_usr = 0, excl_kern = 0, id = { 29, 30, 31, # sibling cores : 0-3 # sibling threads : 0 # sibling threads : 1 # sibling threads : 2 # sibling threads : 3 # node0 meminfo : total = 8320608 kB, free = 7571024 kB # node0 cpu list : 0-3 # ======== # ... Reviewed-by: David Ahern <dsahern@gmail.com> Tested-by: David Ahern <dsahern@gmail.com> Cc: David Ahern <dsahern@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Robert Richter <robert.richter@amd.com> Cc: Andi Kleen <ak@linux.intel.com> Link: http://lkml.kernel.org/r/20110930134040.GA5575@quad Signed-off-by: Stephane Eranian <eranian@google.com> [ committer notes: Use --show-info in the tools as was in the docs, rename perf_header_fprintf_info to perf_file_section__fprintf_info, fixup conflict with f69b64f7 "perf: Support setting the disassembler style" ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/arch/powerpc')