Hi Hitoshi,
As titled, once one of the two conditions is matched, sheep process
create a new config file.
However, cluster info is not assigned at this time so that sheep will
crash at one of the following step.
Why not directly reporting error message and return -1?
int init_config_file(void)
{
int fd, ret;
check_tmp_config();
fd = open(config_path, O_RDONLY);
if (fd < 0) {
if (errno != ENOENT) {
sd_err("failed to read config file, %m");
return -1;
}
goto create;
}
ret = xread(fd, &config, sizeof(config));
if (ret == 0) {
close(fd);
goto create;
}
if (ret < 0) {
sd_err("failed to read config file, %m");
goto out;
}
...
}
--
sheepdog mailing list
sheepdog@lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/sheepdog