From b80d5b947b37c7047375cefcc4f6f3ca93d951d9 Mon Sep 17 00:00:00 2001 From: Kevin Greenan Date: Sat, 12 Sep 2015 17:34:38 -0700 Subject: [PATCH] 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. --- src/utils/chksum/alg_sig.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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; }