From 7d0e6e800e41fd13a5dc51ef05de8298b30b7432 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Mon, 11 Feb 2002 15:42:34 +0000 Subject: o Support locking with local lock files o Disable control-c during updates (except if blocked waiting for a lock) --- tools/lvm.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tools/lvm.c') diff --git a/tools/lvm.c b/tools/lvm.c index c2f6f70f..a77db806 100644 --- a/tools/lvm.c +++ b/tools/lvm.c @@ -720,6 +720,7 @@ static char *_copy_command_line(struct pool *mem, int argc, char **argv) static int run_command(int argc, char **argv) { int ret = 0; + int locking_type; if (!(cmd->cmd_line = _copy_command_line(cmd->mem, argc, argv))) return ECMD_FAILED; @@ -739,8 +740,18 @@ static int run_command(int argc, char **argv) _use_settings(&_current_settings); + locking_type = find_config_int(cmd->cf->root, "global/locking_type", + '/', 1); + if (!init_locking(locking_type, cmd->cf)) { + log_error("Locking type %d initialisation failed.", + locking_type); + return 0; + } + ret = the_command->fn(argc, argv); + fin_locking(); + /* * set the debug and verbose levels back * to the global default. We have to do -- cgit