Closed bdrung closed 5 years ago
(I think that) the only occurrence is in complib_init function which returns void ;-(
complin_init function API could be changed to return status rather than void and fix internal uses of this function to exit on bad status but that breaks out of tree uses.
A new function (complib_init_v2) that returns status could easily be added and change all internal uses to that as well as deprecate the old function but old function wouldn't be removed for several releases.
To me latter approach is least bad or do you see other/better approach ?
Besides complib_init
, __hca_sim_get_num_cas
calls exit()
which is used by osm_vendor_get_all_port_attr
, osm_vendor_get_guid_ca_and_port
, and osm_vendor_get_guid_by_ca_and_port
.
The latter approach sound better to me as well.
Implemented patch to deprecate complib_init and add complib_init_v2. Sent to you for review.
The other routines you mentioned are in libvendor. I will work on those tomorrow in a separate patch.
Fixes are pretty simple for libvendor/osm_vendor_mlx_hca_sim.c and libvendor/osm_vendor_mlx_sim.c but not sure if it's worth doing this as ibutils (which contains ibmgtsim) has been deprecated for quite some time.
Just sent patch with the libvendor changes.
Reviewed and test-build both patches. They look good to me.
The shared library libosmcomp.so calls the C library
exit()
or_exit()
functions.In the case of an error, the library should instead return an appropriate error code to the calling program which can then determine how to handle the error, including performing any required clean-up.