Commit 9ff22be1 authored by Lubomir Bulej's avatar Lubomir Bulej

Use a function to load instrumentation jars

parent 704e5537
......@@ -99,21 +99,14 @@ __load_file (const char * name, void ** buffer, size_t * size) {
*/
static void
load_files_to_buffers(struct inst_jar * jars, const size_t count) {
FILE * file;
// Open the files and ensure that all of them exists
// Load all instrumentation jars or fail.
for (size_t i = 0; i < count; ++i) {
file = fopen(jars[i].name, "r");
assert(file != NULL);
jars[i].filesize = (size_t)get_filesize(jars[i].name);
jars[i].buffer = malloc(jars[i].filesize);
fread(jars[i].buffer, 1, jars[i].filesize, file);
fclose(file);
struct inst_jar * jar = &(jars [i]);
__load_file (jar->name, &(jar->buffer), &(jar->filesize));
}
}
/*
* Instrumentation delivery message build
* @param config
......
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