Commit 61863b1c authored by Philip Carns's avatar Philip Carns
Browse files

clean up fault handling for bad target names

parent 8bb793cb
......@@ -190,7 +190,8 @@ static int bake_file_backend_initialize(bake_provider_t provider,
new_entry->log_fd
= abt_io_open(new_entry->abtioi, path, O_RDWR | O_DIRECT, 0);
if (new_entry->log_fd < 0) {
perror("open");
fprintf(stderr, "open(): %s on %s\n", strerror(-new_entry->log_fd),
path);
ret = BAKE_ERR_IO;
goto error_cleanup;
}
......
......@@ -109,6 +109,7 @@ int main(int argc, char** argv)
mid = margo_init(opts.listen_addr_str, MARGO_SERVER_MODE, 0, -1);
if (mid == MARGO_INSTANCE_NULL) {
fprintf(stderr, "Error: margo_init()\n");
free(opts.bake_pools);
return (-1);
}
......@@ -126,6 +127,7 @@ int main(int argc, char** argv)
hret = margo_addr_self(mid, &self_addr);
if (hret != HG_SUCCESS) {
fprintf(stderr, "Error: margo_addr_self()\n");
free(opts.bake_pools);
margo_finalize(mid);
return (-1);
}
......@@ -133,6 +135,7 @@ int main(int argc, char** argv)
self_addr);
if (hret != HG_SUCCESS) {
fprintf(stderr, "Error: margo_addr_to_string()\n");
free(opts.bake_pools);
margo_addr_free(mid, self_addr);
margo_finalize(mid);
return (-1);
......@@ -141,6 +144,7 @@ int main(int argc, char** argv)
fp = fopen(opts.host_file, "w");
if (!fp) {
free(opts.bake_pools);
perror("fopen");
margo_finalize(mid);
return (-1);
......@@ -169,6 +173,7 @@ int main(int argc, char** argv)
if (ret != 0) {
bake_perror("Error: bake_provider_register()", ret);
free(opts.bake_pools);
margo_finalize(mid);
return (-1);
}
......@@ -178,6 +183,7 @@ int main(int argc, char** argv)
if (ret != 0) {
bake_perror("Error: bake_provider_add_storage_target()", ret);
free(opts.bake_pools);
margo_finalize(mid);
return (-1);
}
......@@ -208,6 +214,7 @@ int main(int argc, char** argv)
if (ret != 0) {
bake_perror("Error: bake_provider_register()", ret);
free(opts.bake_pools);
margo_finalize(mid);
return (-1);
}
......@@ -219,6 +226,7 @@ int main(int argc, char** argv)
if (ret != 0) {
bake_perror("Error: bake_provider_add_storage_target()", ret);
free(opts.bake_pools);
margo_finalize(mid);
return (-1);
}
......
......@@ -25,13 +25,13 @@ static char* bake_err_str(int ret)
return "An argument is invalid";
break;
case BAKE_ERR_MERCURY:
return "An error happend calling a Mercury function";
return "An error happened calling a Mercury function";
break;
case BAKE_ERR_ARGOBOTS:
return "An error happened calling an Argobots function";
break;
case BAKE_ERR_PMEM:
return "An error happend calling a PMDK function";
return "An error happened calling a PMDK function";
break;
case BAKE_ERR_UNKNOWN_TARGET:
return "Target refered to by id is not know to provider";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment