All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: device-mapper development <dm-devel@redhat.com>,
	christophe.varoqui@opensvc.com
Cc: Ritesh Raj Sarraf <rrs@debian.org>
Subject: Re: [PATCH 3/3] Library with an exit()
Date: Sun, 09 Mar 2014 13:27:21 +0100	[thread overview]
Message-ID: <531C5E29.6050805@acm.org> (raw)
In-Reply-To: <1394366195-3053-3-git-send-email-rrs@debian.org>

On 03/09/14 12:56, Ritesh Raj Sarraf wrote:
> Signed-off-by: Ritesh Raj Sarraf <rrs@debian.org>
> ---
>  libmpathpersist/mpath_persist.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/libmpathpersist/mpath_persist.c b/libmpathpersist/mpath_persist.c
> index bd30125..6b6901e 100644
> --- a/libmpathpersist/mpath_persist.c
> +++ b/libmpathpersist/mpath_persist.c
> @@ -585,11 +585,12 @@ int send_prout_activepath(char * dev, int rq_servact, int rq_scope,
>  	rc = pthread_create(&thread, &attr, mpath_prout_pthread_fn, (void *)(&param));
>  	if (rc){
>  		condlog (3, "%s: failed to create thread %d", dev, rc);
> -		exit(-1);
>  	}
> -	/* Free attribute and wait for the other threads */
> -	pthread_attr_destroy(&attr);
> -	rc = pthread_join(thread, NULL);
> +	else {
> +		/* Free attribute and wait for the other threads */
> +		pthread_attr_destroy(&attr);
> +		rc = pthread_join(thread, NULL);
> +	}
>  
>  	return (param.status);
>  }

pthread_attr_destroy() should also be called if pthread_create() fails.

Bart.

  reply	other threads:[~2014-03-09 12:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-09 11:56 [PATCH 1/3] Fix build failure with fomat-security. Specify the format type Ritesh Raj Sarraf
2014-03-09 11:56 ` [PATCH 2/3] Minor spelling error fixes Ritesh Raj Sarraf
2014-03-09 11:56 ` [PATCH 3/3] Library with an exit() Ritesh Raj Sarraf
2014-03-09 12:27   ` Bart Van Assche [this message]
2014-03-10 22:22     ` Christophe Varoqui

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=531C5E29.6050805@acm.org \
    --to=bvanassche@acm.org \
    --cc=christophe.varoqui@opensvc.com \
    --cc=dm-devel@redhat.com \
    --cc=rrs@debian.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.