summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorKevin Greenan <kmg@box.com>2015-09-12 17:34:38 -0700
committerKevin Greenan <kmg@box.com>2015-09-12 17:34:38 -0700
commitb80d5b947b37c7047375cefcc4f6f3ca93d951d9 (patch)
tree86f9da57f57a1b1ddb3b19d48823a6da9522ef45 /src/utils
parent0c703b047a851aec93384e1eefc39155816ed445 (diff)
downloadliberasurecode-b80d5b947b37c7047375cefcc4f6f3ca93d951d9.tar.gz
Fixing Issue #19 by stubbing out Jerasures uninit function.
If the underlying jerasure implementation is old (pre-jerasure.org), then it will not contain an uninit function for the underlying GF object. Since this is only used in alg_sig, which is not used by anything else at the moment, we stub it out if it does not exist. Once we make the change to have alg_sig use the internal GF functions, this whole problem goes away.
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/chksum/alg_sig.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/utils/chksum/alg_sig.c b/src/utils/chksum/alg_sig.c
index 9dd7a27..86740e6 100644
--- a/src/utils/chksum/alg_sig.c
+++ b/src/utils/chksum/alg_sig.c
@@ -47,6 +47,8 @@ galois_single_multiply_func get_galois_multi_func(void *handle) {
return func_handle.fptr;
}
+void stub_galois_uninit_field(int w){}
+
galois_uninit_field_func get_galois_uninit_func(void *handle) {
/*
* ISO C forbids casting a void* to a function pointer.
@@ -74,6 +76,19 @@ int load_gf_functions(void *sohandle, struct jerasure_mult_routines *routines)
if (NULL == routines->galois_single_multiply) {
return -1;
}
+ /**
+ * It is possible that the underlying Jerasure implementation
+ * is old (pre-jerasure.org). If so, there is not an uninit
+ * function, so these tests will fail.
+ *
+ * Since nothing is using alg_sig at the moment, we stub the
+ * uninit function to unblock the tests. Once we plug the internal
+ * GF functions into alg_sig, this can jsut go away.
+ */
+ if (NULL == routines->galois_uninit_field) {
+ routines->galois_uninit_field = &stub_galois_uninit_field;
+ }
+
return 0;
}