aboutsummaryrefslogtreecommitdiff
path: root/tree.c
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@linaro.org>2016-02-22 15:02:57 +0100
committerDaniel Lezcano <daniel.lezcano@linaro.org>2016-02-22 15:02:57 +0100
commitd42d7ad53a619b4dd2fc3e9194721fd8b0c6de0a (patch)
treefef07011a5bdc2893761ea888494b47c7964b941 /tree.c
parent1eedd480214d97dd80defc19b0849ea45cd692ef (diff)
Fix display error on screen
The previous patch was reverted and is replaced by this one. Instead of dancing around with global flag telling if a subsys succeed or not and write a error, let's try to initialize the subsystem each time a display is requested and output an error occurs. That makes the code a bit nicer and give the opportunity to fix the problem at the system level (eg. mount debugfs) without restarting powerdebug. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Diffstat (limited to 'tree.c')
-rw-r--r--tree.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/tree.c b/tree.c
index 2728a2d..76f132f 100644
--- a/tree.c
+++ b/tree.c
@@ -127,10 +127,8 @@ static int tree_scan(struct tree *tree, tree_filter_t filter, bool follow)
int ret = 0;
dir = opendir(tree->path);
- if (!dir) {
- printf("error: unable to open directory %s\n", tree->path);
+ if (!dir)
return -1;
- }
while (!readdir_r(dir, &dirent, &direntp)) {