shared: add a single definition of libmount cleanup functions
Use a trivial header file to share mnt_free_tablep and mnt_free_iterp. It would be nicer put this in mount-util.h, but libmount.h is not in the default include path, and the build system would have to be adjusted to pass pkg-config include path in various places, and it's just not worth the trouble. A separate header file works nicely.
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1+ */
|
||||
#pragma once
|
||||
|
||||
/* This needs to be after sys/mount.h */
|
||||
#include <libmount.h>
|
||||
|
||||
#include "macro.h"
|
||||
|
||||
DEFINE_TRIVIAL_CLEANUP_FUNC(struct libmnt_table*, mnt_free_table);
|
||||
DEFINE_TRIVIAL_CLEANUP_FUNC(struct libmnt_iter*, mnt_free_iter);
|
||||
@@ -95,6 +95,7 @@ shared_sources = files('''
|
||||
json-internal.h
|
||||
json.c
|
||||
json.h
|
||||
libmount-util.h
|
||||
lockfile-util.c
|
||||
lockfile-util.h
|
||||
log-link.h
|
||||
|
||||
Reference in New Issue
Block a user