On 04/10/2013 12:32 AM, Hitoshi Mitake wrote:
> +void clean_journal_file(const char *p)
> +{
> +     int ret;
> +     char path[PATH_MAX];
> +
> +     snprintf(path, sizeof(path), "%s/%s", p, jfile_name[0]);
> +     ret = unlink(path);
> +     if (ret < 0)
> +             sd_eprintf("unlink(%s): %m", path);
> +
> +     snprintf(path, sizeof(path), "%s/%s", p, jfile_name[1]);
> +     ret = unlink(path);
> +     if (ret < 0)
> +             sd_eprintf("unlink(%s): %m", path);
> +}

We need call sync() to assure the data reach the disks before unlink()
the jfile.

Thanks,
Yuan
-- 
sheepdog mailing list
[email protected]
http://lists.wpkg.org/mailman/listinfo/sheepdog

Reply via email to