[sheepdog] [PATCH v2 4/4] sheep: let config use atomic_create_and_write()

Liu Yuan namei.unix at gmail.com
Wed Apr 17 10:04:34 CEST 2013


On 04/17/2013 03:58 PM, Hitoshi Mitake wrote:
> +static void check_tmp_config(void)
> +{
> +	char tmp_config_path[PATH_MAX];
> +
> +	snprintf(tmp_config_path, PATH_MAX, "%s.tmp", config_path);
> +
> +	if (!access(tmp_config_path, F_OK))
> +		return;
> +
> +	sd_iprintf("remove temporal config file");
> +	unlink(tmp_config_path);
>  }
>  

Access not removed ? Then it is better fold check_tmp_config() into its
caller.

Thanks,
Yuan



More information about the sheepdog mailing list