This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix nptl/tst-setuid3.c


On 01/19/2016 09:09 PM, Paul E. Murphy wrote:
> pthread_barrier_wait can return either PTHREAD_BARRIER_SERIAL_THREAD
> or 0.  Posix makes no guarantees about which thread return the unique
> value.
> 
> Additionally, pthread_join was not called despite seemingly checking
> for the error.
> 
> 2016-01-19  Paul E. Murphy  <murphyp@linux.vnet.ibm.com>
> 
> 	* nptl/tst-setuid3.c (INVALID_BARRIER_WAIT): New macro.
> 	(do_test): Use macro to simplify checking barrier exit
> 	code, and actually join the child thread.

Thanks for fixing this.

> +/* True if pthread_barrier_wait returns without an error.  */
> +#define INVALID_BARRIER_WAIT(x) ((x != 0) && \
> +				 (x != PTHREAD_BARRIER_SERIAL_THREAD))

Please use an inline function or put parentheses around the x.

Technically, this change is okay, but Adhemerval needs to decide if it
can go in during the freeze.

Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]