summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Jakma <paul@quagga.net>2010-01-11 16:30:45 +0000
committerPaul Jakma <paul@quagga.net>2010-12-08 16:53:09 +0000
commit8526100eebf9c56ff6fac2b80938b232bb687946 (patch)
tree72b217f80791f29632db0ddefffb97a4943dfb00
parent838bbde0426e562132d22fb11932ea413aebf928 (diff)
lib: thread history funcname shouldn't be constant, it's freed
* thread.h: (struct cpu_thread_history.funcname) malloc gets called on this so it should not be const * thread.c: (cpu_record_print) cast the (const char *) to (char *), this function knows what it's doing (free wont be called on it).
-rw-r--r--lib/thread.c2
-rw-r--r--lib/thread.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/thread.c b/lib/thread.c
index e89af541..af52b057 100644
--- a/lib/thread.c
+++ b/lib/thread.c
@@ -303,7 +303,7 @@ cpu_record_print(struct vty *vty, thread_type filter)
void *args[3] = {&tmp, vty, &filter};
memset(&tmp, 0, sizeof tmp);
- tmp.funcname = "TOTAL";
+ tmp.funcname = (char *)"TOTAL";
tmp.types = filter;
#ifdef HAVE_RUSAGE
diff --git a/lib/thread.h b/lib/thread.h
index b52bc541..937bedbb 100644
--- a/lib/thread.h
+++ b/lib/thread.h
@@ -82,7 +82,7 @@ struct thread
struct cpu_thread_history
{
int (*func)(struct thread *);
- const char *funcname;
+ char *funcname;
unsigned int total_calls;
struct time_stats
{