mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-11 10:50:01 +01:00
Add utilities cleanup routine.
This commit is contained in:
committed by
Milan Broz
parent
74c943c352
commit
4a43a2773a
@@ -127,6 +127,10 @@ static const char **action_argv;
|
|||||||
static int action_argc;
|
static int action_argc;
|
||||||
static const char *null_action_argv[] = {NULL, NULL};
|
static const char *null_action_argv[] = {NULL, NULL};
|
||||||
|
|
||||||
|
void tools_cleanup(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
static const char *uuid_or_device_header(const char **data_device)
|
static const char *uuid_or_device_header(const char **data_device)
|
||||||
{
|
{
|
||||||
if (data_device)
|
if (data_device)
|
||||||
|
|||||||
@@ -116,6 +116,9 @@ int tools_wipe_all_signatures(const char *path);
|
|||||||
int tools_lookup_crypt_device(struct crypt_device *cd, const char *type,
|
int tools_lookup_crypt_device(struct crypt_device *cd, const char *type,
|
||||||
const char *data_device_path, char *name, size_t name_length);
|
const char *data_device_path, char *name, size_t name_length);
|
||||||
|
|
||||||
|
/* each utility is required to implement it */
|
||||||
|
void tools_cleanup(void);
|
||||||
|
|
||||||
/* Log */
|
/* Log */
|
||||||
#define log_dbg(x...) clogger(NULL, CRYPT_LOG_DEBUG, __FILE__, __LINE__, x)
|
#define log_dbg(x...) clogger(NULL, CRYPT_LOG_DEBUG, __FILE__, __LINE__, x)
|
||||||
#define log_std(x...) clogger(NULL, CRYPT_LOG_NORMAL, __FILE__, __LINE__, x)
|
#define log_std(x...) clogger(NULL, CRYPT_LOG_NORMAL, __FILE__, __LINE__, x)
|
||||||
|
|||||||
@@ -117,6 +117,10 @@ typedef enum {
|
|||||||
CHECK_OPEN,
|
CHECK_OPEN,
|
||||||
} header_magic;
|
} header_magic;
|
||||||
|
|
||||||
|
void tools_cleanup(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
static void _quiet_log(int level, const char *msg, void *usrptr)
|
static void _quiet_log(int level, const char *msg, void *usrptr)
|
||||||
{
|
{
|
||||||
if (!opt_debug)
|
if (!opt_debug)
|
||||||
|
|||||||
@@ -63,6 +63,10 @@ static const char *integrity_alg = DEFAULT_ALG_NAME;
|
|||||||
static const char **action_argv;
|
static const char **action_argv;
|
||||||
static int action_argc;
|
static int action_argc;
|
||||||
|
|
||||||
|
void tools_cleanup(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
// FIXME: move this to tools and handle EINTR
|
// FIXME: move this to tools and handle EINTR
|
||||||
static int _read_mk(const char *file, char **key, int keysize)
|
static int _read_mk(const char *file, char **key, int keysize)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -238,6 +238,7 @@ __attribute__ ((noreturn)) void usage(poptContext popt_context,
|
|||||||
poptPrintUsage(popt_context, stderr, 0);
|
poptPrintUsage(popt_context, stderr, 0);
|
||||||
if (error)
|
if (error)
|
||||||
log_err("%s: %s", more, error);
|
log_err("%s: %s", more, error);
|
||||||
|
tools_cleanup();
|
||||||
poptFreeContext(popt_context);
|
poptFreeContext(popt_context);
|
||||||
exit(exitcode);
|
exit(exitcode);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,6 +46,10 @@ static int opt_check_at_most_once = 0;
|
|||||||
static const char **action_argv;
|
static const char **action_argv;
|
||||||
static int action_argc;
|
static int action_argc;
|
||||||
|
|
||||||
|
void tools_cleanup(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
static int _prepare_format(struct crypt_params_verity *params,
|
static int _prepare_format(struct crypt_params_verity *params,
|
||||||
const char *data_device,
|
const char *data_device,
|
||||||
uint32_t flags)
|
uint32_t flags)
|
||||||
|
|||||||
Reference in New Issue
Block a user