* [Powertop] [PATCH] report: fixed crash when writing report to RO filesystem
@ 2012-11-28 15:42
0 siblings, 0 replies; 3+ messages in thread
From: @ 2012-11-28 15:42 UTC (permalink / raw)
To: powertop
[-- Attachment #1: Type: text/plain, Size: 1042 bytes --]
Signed-off-by: Jaroslav Škarvada <jskarvad(a)redhat.com>
---
src/report/report.cpp | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/report/report.cpp b/src/report/report.cpp
index 51bc6a7..c018bb1 100644
--- a/src/report/report.cpp
+++ b/src/report/report.cpp
@@ -183,13 +183,16 @@ void init_report_output(char *filename_str, int iterations)
void finish_report_output(void)
{
- fprintf(stderr, _("PowerTOP outputing using base filename %s\n"), reportout.filename);
if (reporttype == REPORT_OFF)
return;
report.finish_report();
- fputs(report.get_result(), reportout.report_file);
- fdatasync(fileno(reportout.report_file));
- fclose(reportout.report_file);
+ if (reportout.report_file)
+ {
+ fprintf(stderr, _("PowerTOP outputing using base filename %s\n"), reportout.filename);
+ fputs(report.get_result(), reportout.report_file);
+ fdatasync(fileno(reportout.report_file));
+ fclose(reportout.report_file);
+ }
report.clear_result();
}
--
1.7.11.7
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Powertop] [PATCH] report: fixed crash when writing report to RO filesystem
@ 2012-11-28 16:02 Sergey Senozhatsky
0 siblings, 0 replies; 3+ messages in thread
From: Sergey Senozhatsky @ 2012-11-28 16:02 UTC (permalink / raw)
To: powertop
[-- Attachment #1: Type: text/plain, Size: 1164 bytes --]
On (11/28/12 16:42), Jaroslav Škarvada wrote:
> Signed-off-by: Jaroslav Škarvada <jskarvad(a)redhat.com>
> ---
looks good to me.
-ss
> src/report/report.cpp | 11 +++++++----
> 1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/src/report/report.cpp b/src/report/report.cpp
> index 51bc6a7..c018bb1 100644
> --- a/src/report/report.cpp
> +++ b/src/report/report.cpp
> @@ -183,13 +183,16 @@ void init_report_output(char *filename_str, int iterations)
>
> void finish_report_output(void)
> {
> - fprintf(stderr, _("PowerTOP outputing using base filename %s\n"), reportout.filename);
> if (reporttype == REPORT_OFF)
> return;
>
> report.finish_report();
> - fputs(report.get_result(), reportout.report_file);
> - fdatasync(fileno(reportout.report_file));
> - fclose(reportout.report_file);
> + if (reportout.report_file)
> + {
> + fprintf(stderr, _("PowerTOP outputing using base filename %s\n"), reportout.filename);
> + fputs(report.get_result(), reportout.report_file);
> + fdatasync(fileno(reportout.report_file));
> + fclose(reportout.report_file);
> + }
> report.clear_result();
> }
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Powertop] [PATCH] report: fixed crash when writing report to RO filesystem
@ 2012-11-29 15:57 Chris Ferron
0 siblings, 0 replies; 3+ messages in thread
From: Chris Ferron @ 2012-11-29 15:57 UTC (permalink / raw)
To: powertop
[-- Attachment #1: Type: text/plain, Size: 1194 bytes --]
On 11/28/2012 07:42 AM, Jaroslav Škarvada wrote:
> Signed-off-by: Jaroslav Škarvada <jskarvad(a)redhat.com>
> ---
> src/report/report.cpp | 11 +++++++----
> 1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/src/report/report.cpp b/src/report/report.cpp
> index 51bc6a7..c018bb1 100644
> --- a/src/report/report.cpp
> +++ b/src/report/report.cpp
> @@ -183,13 +183,16 @@ void init_report_output(char *filename_str, int iterations)
>
> void finish_report_output(void)
> {
> - fprintf(stderr, _("PowerTOP outputing using base filename %s\n"), reportout.filename);
> if (reporttype == REPORT_OFF)
> return;
>
> report.finish_report();
> - fputs(report.get_result(), reportout.report_file);
> - fdatasync(fileno(reportout.report_file));
> - fclose(reportout.report_file);
> + if (reportout.report_file)
> + {
> + fprintf(stderr, _("PowerTOP outputing using base filename %s\n"), reportout.filename);
> + fputs(report.get_result(), reportout.report_file);
> + fdatasync(fileno(reportout.report_file));
> + fclose(reportout.report_file);
> + }
> report.clear_result();
> }
You patch has been merged.
Thank You
Chris
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-11-29 15:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-29 15:57 [Powertop] [PATCH] report: fixed crash when writing report to RO filesystem Chris Ferron
-- strict thread matches above, loose matches on Subject: below --
2012-11-28 16:02 Sergey Senozhatsky
2012-11-28 15:42
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.