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).
This commit is contained in:
Paul Jakma 2010-01-11 16:30:45 +00:00
parent 838bbde042
commit 8526100eeb
2 changed files with 2 additions and 2 deletions

View File

@ -303,7 +303,7 @@ cpu_record_print(struct vty *vty, thread_type filter)
void *args[3] = {&tmp, vty, &filter}; void *args[3] = {&tmp, vty, &filter};
memset(&tmp, 0, sizeof tmp); memset(&tmp, 0, sizeof tmp);
tmp.funcname = "TOTAL"; tmp.funcname = (char *)"TOTAL";
tmp.types = filter; tmp.types = filter;
#ifdef HAVE_RUSAGE #ifdef HAVE_RUSAGE

View File

@ -82,7 +82,7 @@ struct thread
struct cpu_thread_history struct cpu_thread_history
{ {
int (*func)(struct thread *); int (*func)(struct thread *);
const char *funcname; char *funcname;
unsigned int total_calls; unsigned int total_calls;
struct time_stats struct time_stats
{ {