summaryrefslogtreecommitdiff
path: root/tools/pvcreate.c
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2013-07-01 16:30:12 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2013-07-03 14:46:42 +0200
commit6f335ffa35552ed9d002d8a6884c707b2942750c (patch)
treed69c25eae5500e12cef97d3b7c2c147bb71297c8 /tools/pvcreate.c
parentffa11ed35688243a4546d4a35a97fc0339916651 (diff)
downloadlvm2-6f335ffa35552ed9d002d8a6884c707b2942750c.tar.gz
sigint: improve logic on for sigint reaction
Fix and improve handling on sigint. Always check for signal presence *before* calling of command, so it will not call the command when break was hit. If the command has been finished succesfully there is no problem to mark the command ok and not report interrupt at all. Fix cuple related stack; reports and assignments.
Diffstat (limited to 'tools/pvcreate.c')
-rw-r--r--tools/pvcreate.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/pvcreate.c b/tools/pvcreate.c
index d2de4d9a1..b18e40040 100644
--- a/tools/pvcreate.c
+++ b/tools/pvcreate.c
@@ -108,14 +108,14 @@ int pvcreate(struct cmd_context *cmd, int argc, char **argv)
}
for (i = 0; i < argc; i++) {
+ if (sigint_caught())
+ return_ECMD_FAILED;
+
dm_unescape_colons_and_at_signs(argv[i], NULL, NULL);
if (ECMD_PROCESSED != pvcreate_locked(cmd, argv[i], &pp)) {
ret = ECMD_FAILED;
}
-
- if (sigint_caught())
- return ret;
}
return ret;