Skip to content

Commit

Permalink
perf: Fix a build error with some GCC versions
Browse files Browse the repository at this point in the history
Fix this:

 util/cgroup.c: In function ‘open_cgroup’:
 util/cgroup.c:16:16: error: ‘saved_ptr’ may be used uninitialized in this function
 util/cgroup.c:16:16: note: ‘saved_ptr’ was declared here

Apparently newer GCC (4.6) can figure out that this variable is properly
initialized - but some versions of GCC (such as 4.5.2) need help.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Eric Dumazet authored and Ingo Molnar committed Apr 8, 2011
1 parent 0c3efe5 commit 621d265
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/perf/util/cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ cgroupfs_find_mountpoint(char *buf, size_t maxlen)
{
FILE *fp;
char mountpoint[MAX_PATH+1], tokens[MAX_PATH+1], type[MAX_PATH+1];
char *token, *saved_ptr;
char *token, *saved_ptr = NULL;
int found = 0;

fp = fopen("/proc/mounts", "r");
Expand Down

0 comments on commit 621d265

Please sign in to comment.