summaryrefslogtreecommitdiffstats
path: root/dlm/dlm_kill
diff options
context:
space:
mode:
Diffstat (limited to 'dlm/dlm_kill')
-rw-r--r--dlm/dlm_kill/dlm_lock.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/dlm/dlm_kill/dlm_lock.c b/dlm/dlm_kill/dlm_lock.c
index fe15eac..7833570 100644
--- a/dlm/dlm_kill/dlm_lock.c
+++ b/dlm/dlm_kill/dlm_lock.c
@@ -32,6 +32,20 @@
static int ast_called = 0;
static int quit;
+static int do_release(void)
+{
+ static dlm_lshandle_t *dh;
+
+ dh = dlm_create_lockspace("default", 0600);
+ if (!dh) {
+ printf("dlm_lock create lockspace error\n");
+ return -1;
+ }
+
+ dlm_release_lockspace("default", dh, 1);
+ return 0;
+}
+
void sigterm_handler(int sig)
{
quit = 1;
@@ -114,6 +128,11 @@ int main(int argc, char *argv[])
printf("dlm_lock pid %d\n", getpid());
+ if (argc > 1 && !strcmp(argv[1], "release")) {
+ do_release();
+ return 0;
+ }
+
if (argc < 2)
count = 1;
else