mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2024-12-29 17:23:36 +00:00
pm: cpupower: bench: print config file path when open cpufreq-bench.conf fails
Print out the config file path when fopen failed. It will be easy for users to know where to create the file. Since we are here, use strerror to drop the usage of perror. Signed-off-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
This commit is contained in:
parent
7043a9f77c
commit
c0dd6507ab
@ -4,6 +4,7 @@
|
||||
* Copyright (C) 2008 Christian Kornacker <ckornacker@suse.de>
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
@ -165,8 +166,8 @@ 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, %s\n",
|
||||
path, strerror(errno));
|
||||
free(config);
|
||||
return 1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user