This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Make bindresvport() function to multithread-safe
- From: Peng Haitao <penght at cn dot fujitsu dot com>
- To: Mike Frysinger <vapier at gentoo dot org>
- Cc: libc-alpha at sourceware dot org
- Date: Wed, 19 Sep 2012 09:42:53 +0800
- Subject: Re: [PATCH] Make bindresvport() function to multithread-safe
- References: <4F3DED0D.7050504@cn.fujitsu.com> <201209171504.44555.vapier@gentoo.org>
On 09/18/2012 03:04 AM, Mike Frysinger wrote:
> On Friday 17 February 2012 01:00:45 Peng Haitao wrote:
>> @@ -64,6 +70,8 @@ bindresvport (int sd, struct sockaddr_in *sin)
>> return -1;
>> }
>>
>> + __libc_lock_lock (lock);
>> +
>> if (port == 0)
>> {
>> port = (__getpid () % NPORTS) + STARTPORT;
>
> should the lock be acquired here ? or should it be moved to right before the
> "again" label ? i think the latter ...
> -mike
>
Yeah, thanks.
I will send a new patch.
--
Best Regards,
Peng