[PATCH 1/2] pm: cpupower: bench: print path fopen failed
From: Peng Fan (OSS)
Date: Wed Sep 11 2024 - 21:30:37 EST
From: Peng Fan <peng.fan@xxxxxxx>
Print out the config file path when fopen failed. It will be easy
for users to know where to create the file.
Signed-off-by: Peng Fan <peng.fan@xxxxxxx>
---
tools/power/cpupower/bench/parse.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/power/cpupower/bench/parse.c b/tools/power/cpupower/bench/parse.c
index e63dc11fa3a5..366b20f9ddf1 100644
--- a/tools/power/cpupower/bench/parse.c
+++ b/tools/power/cpupower/bench/parse.c
@@ -166,7 +166,7 @@ int prepare_config(const char *path, struct config *config)
configfile = fopen(path, "r");
if (configfile == NULL) {
perror("fopen");
- fprintf(stderr, "error: unable to read configfile\n");
+ fprintf(stderr, "error: unable to read configfile: %s\n", path);
free(config);
return 1;
}
--
2.37.1