All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Ferron <chris.e.ferron at linux.intel.com>
To: powertop@lists.01.org
Subject: Re: [Powertop] [PATCH] report: fixed crash when writing report to RO filesystem
Date: Thu, 29 Nov 2012 07:57:33 -0800	[thread overview]
Message-ID: <50B785ED.6000505@linux.intel.com> (raw)
In-Reply-To: 1354117361-29155-1-git-send-email-jskarvad@redhat.com

[-- 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


             reply	other threads:[~2012-11-29 15:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-29 15:57 Chris Ferron [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-11-28 16:02 [Powertop] [PATCH] report: fixed crash when writing report to RO filesystem Sergey Senozhatsky
2012-11-28 15:42 

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50B785ED.6000505@linux.intel.com \
    --to=powertop@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.