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] ccstoh: Don't return success if something went wrong
Date: Tue, 17 Jul 2012 15:07:26 -0700	[thread overview]
Message-ID: <5005E21E.2040302@linux.intel.com> (raw)
In-Reply-To: 1342125703-23323-1-git-send-email-sw@weilnetz.de

[-- Attachment #1: Type: text/plain, Size: 1067 bytes --]

On 07/12/2012 01:41 PM, Stefan Weil wrote:
> exit(0) is the same as returning EXIT_SUCCESS which is a bad
> idea after a severe failure. It will for example result in
> wrong behaviour of make (make won't stop after such failures).
>
> Returning EXIT_FAILURE fixes this.
>
> Signed-off-by: Stefan Weil <sw(a)weilnetz.de>
> ---
>   src/csstoh.c |    4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/csstoh.c b/src/csstoh.c
> index e6b1dcf..28858f5 100644
> --- a/src/csstoh.c
> +++ b/src/csstoh.c
> @@ -40,12 +40,12 @@ int main(int argc, char **argv)
>   	in = fopen(argv[1], "rm");
>   	if (!in) {
>   		printf("Failed to open input file %s (%s) \n", argv[1], strerror(errno));
> -		exit(0);
> +		return EXIT_FAILURE;
>   	}
>   	out = fopen(argv[2], "wm");
>   	if (!out) {
>   		printf("Failed to open output file %s (%s) \n", argv[1], strerror(errno));
> -		exit(0);
> +		return EXIT_FAILURE;
>   	}
>   
>   	fprintf(out, "#ifndef __INCLUDE_GUARD_CCS_H\n");
Your patch has been merged.
Thank you,


             reply	other threads:[~2012-07-17 22:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-17 22:07 Chris Ferron [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-07-12 20:41 [Powertop] [PATCH] ccstoh: Don't return success if something went wrong Stefan Weil

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=5005E21E.2040302@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.