diff options
author | Karel Zak | 2013-08-21 14:38:38 +0200 |
---|---|---|
committer | Karel Zak | 2013-08-21 14:38:38 +0200 |
commit | 6195f9e6fab612694ff97e66f9b276b913aa2d24 (patch) | |
tree | e20e772ab6cf20504268c1e776f3cfe6913fd21f /sys-utils/eject.c | |
parent | libmount: add reference counting to libmnt_cache (diff) | |
download | kernel-qcow2-util-linux-6195f9e6fab612694ff97e66f9b276b913aa2d24.tar.gz kernel-qcow2-util-linux-6195f9e6fab612694ff97e66f9b276b913aa2d24.tar.xz kernel-qcow2-util-linux-6195f9e6fab612694ff97e66f9b276b913aa2d24.zip |
misc: use libmnt_cache reference counting
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/eject.c')
-rw-r--r-- | sys-utils/eject.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys-utils/eject.c b/sys-utils/eject.c index 5bcde68ca..b8e16c320 100644 --- a/sys-utils/eject.c +++ b/sys-utils/eject.c @@ -729,7 +729,8 @@ static int device_get_mountpoint(char **devname, char **mnt) if (!mtab) err(EXIT_FAILURE, _("failed to initialize libmount table")); - cache = mnt_new_cache(); + if (!cache) + cache = mnt_new_cache(); mnt_table_set_cache(mtab, cache); if (p_option) @@ -1147,7 +1148,7 @@ int main(int argc, char **argv) free(mountpoint); mnt_free_table(mtab); - mnt_free_cache(cache); + mnt_unref_cache(cache); return EXIT_SUCCESS; } |