Skip to contentSkip to conversation

master - pvremove: Catch CTRL-c during prompts.

PATCH Alasdair Kergon 1 participant 1 message Apr 29, 2014

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b1f765d72aa56dab547a819447371b5315e78455
Commit:        b1f765d72aa56dab547a819447371b5315e78455
Parent:        26989e0cd7fab4768f46803cd25bfc7499ab488e
Author:        Alasdair G Kergon <[email protected]>
AuthorDate:    Tue Apr 29 08:16:28 2014 +0100
Committer:     Alasdair G Kergon <[email protected]>
CommitterDate: Tue Apr 29 08:16:28 2014 +0100

pvremove: Catch CTRL-c during prompts.

---
 WHATS_NEW        |    1 +
 tools/pvremove.c |    2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)
WHATS_NEW +1 -0
index fad66bf..bb5b4c3 100644
@@ -1,5 +1,6 @@
 Version 2.02.107 - 
 ==================================
+  Catch CTRL-c during pvremove prompts.
   Show correct availability status for snapshot origin in lvscan.
   Move segment thin pool/volume info into segment display 'lvdisplay --maps'.
   Display thin pool usage even when just thin volume is available.
tools/pvremove.c +2 -0
index 7048b97..dfd6007 100644
@@ -37,6 +37,8 @@ int pvremove(struct cmd_context *cmd, int argc, char **argv)
 			stack;
 			ret = ECMD_FAILED;
 		}
+		if (sigint_caught())
+			return_ECMD_FAILED;
 	}
 
 	return ret;