[PATCH] smbd: Use mutex instead of fcntl lock for echohandler coordination

Stefan (metze) Metzmacher metze at samba.org
Tue Jul 8 12:26:58 MDT 2014


Am 08.07.2014 19:58, schrieb Christof Schmitt:
> On Tue, Jul 08, 2014 at 12:57:05AM +0200, Stefan (metze) Metzmacher wrote:
>> Hi Christof,
>>
>>> +static bool smbd_echo_active(struct smbd_server_connection *sconn)
>>> +{
>>> +	return (sconn->smb1.echo_handler.socket_lock_fd != -1
>>> +#ifdef HAVE_ROBUST_MUTEXES
>>> +		|| sconn->smb1.echo_handler.socket_mutex != NULL
>>> +#endif
>>> +		);
>>> +}
>>
>> Can you please use if statements like this:
>>
>>
>>    if (sconn->smb1.echo_handler.socket_lock_fd != -1) {
>>        return true;
>>    }
>>
>> #ifdef HAVE_ROBUST_MUTEXES
>>    if (sconn->smb1.echo_handler.socket_mutex != NULL) {
>>        return true;
>>    }
>> #endif
>>
>>    return false;
>>
>> The rest look good thanks!
> 
> Updated in the attached patch.

Reviewed by me, thanks!

metze

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 246 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20140708/f090ee25/attachment.pgp>


More information about the samba-technical mailing list