Close smackfs_mnt_dirfd in the library destructor. Although kernel
would wipe it anyway it is a good practice to clean up all the
reserved resources.
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
return;
}
-void fini_smackmnt(void)
-{
- free(smackfs_mnt);
- smackfs_mnt = NULL;
-}
-
static void init_lib(void) __attribute__ ((constructor));
static void init_lib(void)
{
static void fini_lib(void) __attribute__ ((destructor));
static void fini_lib(void)
{
- fini_smackmnt();
+ if (smackfs_mnt_dirfd >= 0)
+ close(smackfs_mnt_dirfd);
+ free(smackfs_mnt);
+ smackfs_mnt = NULL;
}