diff options
| author | Karel Zak <kzak@redhat.com> | 2023-04-20 10:39:20 +0200 |
|---|---|---|
| committer | Karel Zak <kzak@redhat.com> | 2023-04-20 10:39:20 +0200 |
| commit | 57acbb428daa0e8cc2b24c2dcac507f135a0615d (patch) | |
| tree | f86612a845258b941bef0b8fbe8160aee8e981ca /libmount/src/hooks.c | |
| parent | a55527e6ed506c24a8b25e56381165a1d852b1fd (diff) | |
| download | util-linux-57acbb428daa0e8cc2b24c2dcac507f135a0615d.tar.gz | |
libmount: improve hooks de-initialization
Don't cleanup if all related to the hooks is already empty.
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/hooks.c')
| -rw-r--r-- | libmount/src/hooks.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libmount/src/hooks.c b/libmount/src/hooks.c index c8d45d4791..88cf68d611 100644 --- a/libmount/src/hooks.c +++ b/libmount/src/hooks.c @@ -100,6 +100,10 @@ int mnt_context_deinit_hooksets(struct libmnt_context *cxt) assert(cxt); + if (list_empty(&cxt->hooksets_datas) && + list_empty(&cxt->hooksets_hooks)) + return 0; + for (i = 0; i < ARRAY_SIZE(hooksets); i++) { const struct libmnt_hookset *hs = hooksets[i]; |
