aboutsummaryrefslogtreecommitdiff
path: root/clocks.c
diff options
context:
space:
mode:
authorAmit Arora <amit.arora@linaro.org>2010-11-16 14:56:26 +0530
committerAmit Arora <amit.arora@linaro.org>2010-11-16 14:56:26 +0530
commit813507742ead365b9841df5ac32951c8bf953204 (patch)
treeca21130f6591e7e3ddfa123cd7e46ef829d95851 /clocks.c
parent59429a4aa895d30add54aef4079ea4d8950458f1 (diff)
downloadpowerdebug-813507742ead365b9841df5ac32951c8bf953204.tar.gz
Bug: fix sigsegv for -cd options
Diffstat (limited to 'clocks.c')
-rw-r--r--clocks.c38
1 files changed, 26 insertions, 12 deletions
diff --git a/clocks.c b/clocks.c
index 5eaed47..de2375a 100644
--- a/clocks.c
+++ b/clocks.c
@@ -29,22 +29,36 @@ int init_clock_details(void)
if (path)
strcpy(clk_dir_path, path);
else {
- create_selectedwindow();
- sprintf(clock_lines[0], "Unable to locate debugfs mount point."
- " Mount debugfs and try again..\n");
- print_one_clock(0, clock_lines[0], 1, 0);
- old_clock_line_no = 1;
- return(1);
+ if (!dump) {
+ create_selectedwindow();
+ sprintf(clock_lines[0], "Unable to locate debugfs "
+ "mount point. Mount debugfs "
+ "and try again..\n");
+ print_one_clock(0, clock_lines[0], 1, 0);
+ old_clock_line_no = 1;
+ return(1);
+ } else {
+ fprintf(stderr, "powerdebug: Unable to locate debugfs "
+ "mount point. Mount debugfs and try "
+ "again..\n");
+ exit(1);
+ }
}
sprintf(clk_dir_path, "%s/clock", clk_dir_path);
//strcpy(clk_dir_path, "/debug/clock"); // Hardcoded for testing..
if (stat(clk_dir_path, &buf)) {
- create_selectedwindow();
- sprintf(clock_lines[0], "Unable to find clock tree"
- " information at %s.\n", clk_dir_path);
- print_one_clock(0, clock_lines[0], 1, 0);
- old_clock_line_no = 1;
- return(1);
+ if (!dump) {
+ create_selectedwindow();
+ sprintf(clock_lines[0], "Unable to find clock tree"
+ " information at %s.\n", clk_dir_path);
+ print_one_clock(0, clock_lines[0], 1, 0);
+ old_clock_line_no = 1;
+ return(1);
+ } else {
+ fprintf(stderr, "powerdebug: Unable to find clock tree"
+ " information at %s.\n", clk_dir_path);
+ exit(1);
+ }
}
strcpy(clk_name, "");
return(0);