At Tue, 16 Apr 2013 11:17:04 +0800,
Liu Yuan wrote:
> 
> On 04/15/2013 11:16 PM, Hitoshi Mitake wrote:
> > +static void check_tmp_config(void)
> > +{
> > +   int fd;
> > +
> > +   fd = open(tmp_config_path, O_RDONLY);
> > +   if (fd < 0 && errno == ENOENT)
> > +           return;
> > +
> 
> FD leak.
> 
> > +   sd_iprintf("temporal file for config exists");
> > +   unlink(tmp_config_path);
> 
> It is better to use 'access(2)'.

Thanks, I'll use access in v2.
Hitoshi
-- 
sheepdog mailing list
[email protected]
http://lists.wpkg.org/mailman/listinfo/sheepdog

Reply via email to