lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
 <PAXPR04MB845993F071E47D0C2DC6D0A688612@PAXPR04MB8459.eurprd04.prod.outlook.com>
Date: Tue, 17 Sep 2024 12:37:02 +0000
From: Peng Fan <peng.fan@....com>
To: Shuah Khan <skhan@...uxfoundation.org>, "Peng Fan (OSS)"
	<peng.fan@....nxp.com>, Thomas Renninger <trenn@...e.com>, Shuah Khan
	<shuah@...nel.org>, "John B. Wyatt IV" <jwyatt@...hat.com>, John Kacur
	<jkacur@...hat.com>, "open list:CPU POWER MONITORING SUBSYSTEM"
	<linux-pm@...r.kernel.org>, open list <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 1/2] pm: cpupower: bench: print path fopen failed

> Subject: Re: [PATCH 1/2] pm: cpupower: bench: print path fopen failed
> 
> On 9/11/24 19:38, Peng Fan (OSS) wrote:
> > From: Peng Fan <peng.fan@....com>
> >
> > Print out the config file path when fopen failed. It will be easy for
> > users to know where to create the file.
> 
> Send these two patches as a series with a cover letter.
> 
> Also what is changing - you can include what change: use the same
> subject line in here.
> 
> The subject line can be improved to say more than fopen() failed.
> Which file open failed?
> 
> The message can be informative about which file:
>   about which file.
> 
> e.g: pm: cpupower: bench: print config file path when open fails
> 
> >
> > Signed-off-by: Peng Fan <peng.fan@....com>
> > ---
> >   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);
> 
> While you are at it, fix it to use strerror() instead of calling perror()
> followed by fprintf().

Seems the usage of perror is in the whole file. Could the conversion
to sterror() be done in a separate patch?

Thanks,
Peng.

> 
> 
> >   		free(config);
> >   		return 1;
> >   	}
> 
> thanks,
> -- Shuah

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ