Linux bluetooth development
 help / color / mirror / Atom feed
From: Szymon Janc <szymon.janc@tieto.com>
To: Andrei Emeltchenko <Andrei.Emeltchenko.news@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCHv2 1/2] android/haltest: Close file in case of error
Date: Fri, 07 Feb 2014 11:05:01 +0100	[thread overview]
Message-ID: <6446365.iLMeAT5gVN@uw000953> (raw)
In-Reply-To: <1391696563-7478-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>

Hi Andrei,

On Thursday 06 of February 2014 16:22:42 Andrei Emeltchenko wrote:
> From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> 
> ---
>  android/client/if-audio.c | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/android/client/if-audio.c b/android/client/if-audio.c
> index 66f8364..3b34c95 100644
> --- a/android/client/if-audio.c
> +++ b/android/client/if-audio.c
> @@ -258,19 +258,26 @@ static void play_p(int argc, const char **argv)
>  
>  	if (buffer_size == 0) {
>  		haltest_error("Invalid buffer size. Was stream_out opened?\n");
> -		return;
> +		goto fail;
>  	}
>  
>  	pthread_mutex_lock(&state_mutex);
>  	if (current_state != STATE_STOPPED) {
>  		haltest_error("Already playing or stream suspended!\n");
>  		pthread_mutex_unlock(&state_mutex);
> -		return;
> +		goto fail;
>  	}
>  	pthread_mutex_unlock(&state_mutex);
>  
> -	if (pthread_create(&play_thread, NULL, playback_thread, in) != 0)
> +	if (pthread_create(&play_thread, NULL, playback_thread, in) != 0) {
>  		haltest_error("Cannot create playback thread!\n");
> +		goto fail;
> +	}
> +
> +	return;
> +fail:
> +	if (in)
> +		fclose(in);
>  }
>  
>  static void stop_p(int argc, const char **argv)
> 

This patch is now upstream, thanks.

-- 
Best regards, 
Szymon Janc

      parent reply	other threads:[~2014-02-07 10:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-05 15:44 [PATCH] android/haltest: Close file in case of error Andrei Emeltchenko
2014-02-06 14:13 ` Andrei Emeltchenko
2014-02-06 14:22 ` [PATCHv2 1/2] " Andrei Emeltchenko
2014-02-06 14:22   ` [PATCHv2 2/2] android/haltest: Remove unneeded assignment Andrei Emeltchenko
2014-02-07 10:05   ` Szymon Janc [this message]

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=6446365.iLMeAT5gVN@uw000953 \
    --to=szymon.janc@tieto.com \
    --cc=Andrei.Emeltchenko.news@gmail.com \
    --cc=linux-bluetooth@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox