[PATCH] Don't fail to create passwd and group files if /etc already exists

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Feb 20 12:00:48 UTC 2015


On 20/02/15 12:18, Chris Johns wrote:
> On 20/02/2015 8:29 pm, Sebastian Huber wrote:
>>
>> On 20/02/15 10:06, Nick Withers wrote:
>>> On Fri, 2015-02-20 at 08:59 +0100, Sebastian Huber wrote:
>>>> >Hello Nick,
>>>> >
>>>> >thanks for the patch. I checked in a slightly different version which
>>>> >ignores the return status completely.
>>> Hi Sebastian,
>>>
>>> Your commit effectively reverts Joel's changes in
>>> https://git.rtems.org/rtems/commit/?id=3211e8e9c0565fae8b13ba0115e3a23ad3ae8ade 
>>>
>>>
>>>
>>> Would chucking a (void) in front of the mkdir() shut Coverity up?
>>
>> Ok, I should have checked the commit history since I wondered why I
>> added this error check in the first place. Lets try a (void) cast.
>>
>
> What about doing a stat, create the directory if not present and then 
> error on a mkdir failure ? There are other failures that could happen 
> making a directory that we should correctly report. 

The stat approach is not thread safe.

Its up to the users of the create files to do the error handling.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.




More information about the devel mailing list