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,
Yuan
-- 
sheepdog mailing list
[email protected]
http://lists.wpkg.org/mailman/listinfo/sheepdog

Reply via email to