From: Martin Wilck <mwi...@suse.com> Reviewed-by: Benjamin Marzinski <bmarz...@redhat.com> Signed-off-by: Martin Wilck <mwi...@suse.com> --- mpathpersist/main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/mpathpersist/main.c b/mpathpersist/main.c index 3c2e657..14245cc 100644 --- a/mpathpersist/main.c +++ b/mpathpersist/main.c @@ -641,11 +641,10 @@ int main(int argc, char *argv[]) if (libmpathpersist_init()) { exit(1); } + if (atexit((void(*)(void))libmpathpersist_exit)) + fprintf(stderr, "failed to register cleanup handler for libmpathpersist: %m"); ret = handle_args(argc, argv, 0); - - libmpathpersist_exit(); - return (ret >= 0) ? ret : MPATH_PR_OTHER; } -- 2.28.0 -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel