28d3ae407e
This is an automated DistroBaker update from upstream sources. If you do not know what this is about or would like to opt out, contact the OSCI team. Source: https://src.fedoraproject.org/rpms/device-mapper-multipath.git#26a2cd7a3e189bf91263d17bc8a8c449cc043fb0
33 lines
911 B
Diff
33 lines
911 B
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Martin Wilck <mwilck@suse.com>
|
|
Date: Wed, 23 Sep 2020 00:32:48 +0200
|
|
Subject: [PATCH] mpathpersist: use atexit() for cleanup handlers
|
|
|
|
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
|
|
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
|
---
|
|
mpathpersist/main.c | 5 ++---
|
|
1 file changed, 2 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/mpathpersist/main.c b/mpathpersist/main.c
|
|
index 3c2e6576..14245cc3 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.17.2
|
|
|