On Wed, Jul 18, 2012 at 3:08 PM, Daniel Wagner <[email protected]> wrote:

> On 18.07.2012 13:58, Gustavo Sverzut Barbieri wrote:
>
>> the entire code above should be common to "case DT_DIR". An idea to
>>>> clean this up:
>>>>
>>>> Add "case DT_UNKOWN" before "case DT_DIR" and let it fall-through
>>>> without a break statement if it's a dir.
>>>>
>>>
>>> meh... of course this doesn't work. But you should put together the
>>> common part nonetheless. Maybe using a flag isdir and if/else it's
>>> easier
>>>
>>
>>
>> I wonder why fstatat() then stat(). He should just do the fstatat() on the
>> final name, then concatenate the 2 path components.
>>
>>
This makes sense. I can assume that STORAGEDIR/d->d_name is a dir and just
fstatat/stat on "settings". If it fails, this could be
that STORAGEDIR/d->d_name is not a dir a dir or there is no settings file
inside. So it will "continue". I can patch this.


> And god, you know the size of path prefix, just join the strings wisely and
>> not sprintf it :-/
>>
>
>
I don't get it here. Would you please detail it a little. I don't
understand why a string concat would be better than a sprinf...

Thank you,
ag
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to