[haiku-commits] Re: haiku: hrev45146 - src/libs/compat/freebsd_network

  • From: Jérôme Duval <korli@xxxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 10 Jan 2013 23:57:49 +0100

2013/1/10 Urias McCullough <umccullough@xxxxxxxxx>:
>>  {
>> -       if (options == MTX_DEF) {
>> +       if (options & MTX_DEF) {
>>                 mutex_init_etc(&mutex->u.mutex.lock, name, 
>> MUTEX_FLAG_CLONE_NAME);
>>                 mutex->u.mutex.owner = -1;
>> -       } else if (options == MTX_RECURSE) {
>> +       } else if (options & MTX_RECURSE) {
>>                 recursive_lock_init_etc(&mutex->u.recursive, name,
>>                         MUTEX_FLAG_CLONE_NAME);
>>         } else
>
> If that's the case, shouldn't those theoretically be separate if
> statements rather than using else?
>
> Or are those mutually-exclusive flags?

The both we care of are exclusive since they are types. On the other
hand, MTX_QUIET and MTX_DUPOK are option flags.
But as I now understand, MTX_DEF means *default* and shouldn't be
tested... fixed hopefully in hrev45147.

Thanks for the note!

Bye,
Jérôme

Other related posts: