gluster-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gluster-devel] [PATCH BUG:361 2/3] OS X: fnctl() flag FNM_EXTMATCH


From: noah williamsson
Subject: Re: [Gluster-devel] [PATCH BUG:361 2/3] OS X: fnctl() flag FNM_EXTMATCH is not supported under Mac OS X
Date: Mon, 27 Sep 2010 21:48:57 +0200

2010/9/27 Amar Tumballi <address@hidden>:
> How about having
>
> #define FNM_EXTMATCH 0
>
> in #ifdef DARWIN_OS section of 'libglusterfs/src/compat.h' file??
>
> Idea is to have as less as possible OS specific code inside core, and handle
> maximum possible things in compat.{c,h}
>

That would indeed be more elegant, however, given the fact that
FNM_EXTMATCH is a GNU fnmatch() extension, maybe it should be
considered to get rid of its use completely to get a consistent
behavior across different OSes?


> -Amar
>
> On Mon, Sep 27, 2010 at 6:47 PM, Noah Williamsson
> <address@hidden> wrote:
>>
>> Signed-off-by: Noah Williamsson <address@hidden>
>> ---
>>  libglusterfs/src/xlator.c |    5 +++++
>>  1 files changed, 5 insertions(+), 0 deletions(-)
>>
>> diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c
>> index 3930880..2e48f75 100644
>> --- a/libglusterfs/src/xlator.c
>> +++ b/libglusterfs/src/xlator.c
>> @@ -375,8 +375,13 @@ _volume_option_value_validate (xlator_t *xl,
>>
>>                for (i = 0; (i < ZR_OPTION_MAX_ARRAY_SIZE) &&
>>                             opt->value[i]; i++) {
>> +#ifdef GF_DARWIN_HOST_OS
>> +                        if (fnmatch (opt->value[i], pair->value->data,
>> +                                     0) == 0) {
>> +#else
>>                         if (fnmatch (opt->value[i], pair->value->data,
>>                                      FNM_EXTMATCH) == 0) {
>> +#endif
>>                                ret = 0;
>>                                break;
>>                        }
>> --
>> 1.6.6.1
>>

-- 
Best regards,
Noah Williamsson



reply via email to

[Prev in Thread] Current Thread [Next in Thread]