mirror of https://github.com/BOINC/boinc.git
Fix logic error at config file reading
A missing output file is not an error in stand-alone mode git-svn-id: svn+ssh://cvs.lpds.sztaki.hu/var/lib/svn/szdg/dcapi/trunk@609 a7169a2c-3604-0410-bc95-c702d8d87f7a
This commit is contained in:
parent
2ee903b17f
commit
317a52b24d
|
@ -164,7 +164,7 @@ int DC_initClient(void)
|
||||||
|
|
||||||
/* Parse the config file if the master sent one */
|
/* Parse the config file if the master sent one */
|
||||||
buf = DC_resolveFileName(DC_FILE_IN, DC_CONFIG_FILE);
|
buf = DC_resolveFileName(DC_FILE_IN, DC_CONFIG_FILE);
|
||||||
if (buf && access(buf, R_OK))
|
if (buf && !access(buf, R_OK))
|
||||||
{
|
{
|
||||||
ret = _DC_parseCfg(buf);
|
ret = _DC_parseCfg(buf);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
@ -224,6 +224,7 @@ int DC_initClient(void)
|
||||||
char *DC_resolveFileName(DC_FileType type, const char *logicalFileName)
|
char *DC_resolveFileName(DC_FileType type, const char *logicalFileName)
|
||||||
{
|
{
|
||||||
char buf[PATH_MAX];
|
char buf[PATH_MAX];
|
||||||
|
int ret;
|
||||||
|
|
||||||
if (!strcmp(logicalFileName, DC_CHECKPOINT_FILE))
|
if (!strcmp(logicalFileName, DC_CHECKPOINT_FILE))
|
||||||
{
|
{
|
||||||
|
@ -252,9 +253,14 @@ char *DC_resolveFileName(DC_FileType type, const char *logicalFileName)
|
||||||
if (type == DC_FILE_TMP)
|
if (type == DC_FILE_TMP)
|
||||||
return strdup(logicalFileName);
|
return strdup(logicalFileName);
|
||||||
|
|
||||||
if (boinc_resolve_filename(logicalFileName, buf, sizeof(buf)))
|
ret = boinc_resolve_filename(logicalFileName, buf, sizeof(buf));
|
||||||
return NULL;
|
if (!ret)
|
||||||
return strdup(buf);
|
return strdup(buf);
|
||||||
|
|
||||||
|
/* Do not fail for missing output files in stand-alone mode */
|
||||||
|
if (!wu_name[0] && type == DC_FILE_OUT)
|
||||||
|
return strdup(logicalFileName);
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DC_sendResult(const char *logicalFileName, const char *path,
|
int DC_sendResult(const char *logicalFileName, const char *path,
|
||||||
|
|
Loading…
Reference in New Issue