[patch iwhd 4/5] make directories that we need in export domain

Pete Zaitcev zaitcev at redhat.com
Thu Apr 7 01:49:04 UTC 2011


On Wed, 06 Apr 2011 14:23:51 +0200
Jim Meyering <jim at meyering.net> wrote:

> > +	path = strdup(filename);
> > +	if (!path)
> > +		return;
> 
> Please save a line and combine the declaration and this initialization:
> 
>    	char *path = strdup(filename);

Jim, I'm not ok with that. The check belongs with the call.
I only initializations that can't fail.

> > +		(void) mkdir(path, 0770);
> 
> It's fine to ignore failure only when it's
> because of a preexisting directory.
> I.e., we must not ignore failure due to e.g., ENOSPC or EIO.
> Which means this function will have to return an
> indication of success or failure.

Will do. In fact I should've done it before, but got sideways thinking
that the stderr of dc-* scripts was not captured right... It's no
excuse anyway.

-- Pete


More information about the iwhd-devel mailing list