db_dump: terminate with error if directory can't be created

This commit is contained in:
Bernd Machenschalk 2014-01-06 11:51:52 +01:00
parent b96e867a2b
commit 1074ec2511
1 changed files with 10 additions and 2 deletions

View File

@ -837,6 +837,16 @@ int main(int argc, char** argv) {
); );
exit(1); exit(1);
} }
retval = boinc_mkdir(spec.output_dir);
if (retval) {
log_messages.printf(MSG_CRITICAL,
"boinc_mkdir(%s): %s; %s\n",
spec.output_dir, boincerror(retval), boinc_db.error_string()
);
exit(1);
}
retval = boinc_db.open( retval = boinc_db.open(
config.replica_db_name, config.replica_db_name,
db_host?db_host:config.replica_db_host, db_host?db_host:config.replica_db_host,
@ -855,8 +865,6 @@ int main(int argc, char** argv) {
); );
} }
boinc_mkdir(spec.output_dir);
unsigned int j; unsigned int j;
for (j=0; j<spec.enumerations.size(); j++) { for (j=0; j<spec.enumerations.size(); j++) {
ENUMERATION& e = spec.enumerations[j]; ENUMERATION& e = spec.enumerations[j];