cluster: RHEL56 - qdisk: mkqdisk argument positioning
Lon Hohberger
lon at fedoraproject.org
Fri Nov 5 15:02:34 UTC 2010
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=5b5c8300ef6f8c8d2105baba7379607d45ce1d84
Commit: 5b5c8300ef6f8c8d2105baba7379607d45ce1d84
Parent: ea929dd303acb1c99112efda799433a4d60aec36
Author: Tatsuo Kawasaki <kawasaki at redhat.com>
AuthorDate: Fri Feb 12 14:42:52 2010 -0500
Committer: Lon Hohberger <lhh at redhat.com>
CommitterDate: Fri Nov 5 10:54:21 2010 -0400
qdisk: mkqdisk argument positioning
mkqdisk debug option (-d) doesn't work after -L option.
This works:
mkqdisk -d -L
This should also work:
mkqdisk -L -d
This patch fixes the behavior.
Resolves: rhbz#555246
Signed-off-by: Lon Hohberger <lhh at redhat.com>
---
cman/qdisk/mkqdisk.c | 23 ++++++++++++++++-------
1 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/cman/qdisk/mkqdisk.c b/cman/qdisk/mkqdisk.c
index 46d6b63..6afdf94 100644
--- a/cman/qdisk/mkqdisk.c
+++ b/cman/qdisk/mkqdisk.c
@@ -37,7 +37,7 @@ main(int argc, char **argv)
{
char device[128];
char *newdev = NULL, *newlabel = NULL;
- int rv, verbose_level = 1;
+ int rv, flg = 0, verbose_level = 1;
printf("mkqdisk v0.6.0\n");
@@ -48,13 +48,12 @@ main(int argc, char **argv)
break;
case 'L':
/* List */
- close(2);
- return find_partitions(NULL, NULL, 0, verbose_level);
- break;
+ flg = rv;
+ break;
case 'f':
- close(2);
- return find_partitions( optarg, device,
- sizeof(device), verbose_level);
+ flg = rv;
+ newlabel = optarg;
+ break;
case 'c':
newdev = optarg;
break;
@@ -70,6 +69,16 @@ main(int argc, char **argv)
}
}
+ /* list */
+ if (flg == 'L') {
+ close(2);
+ return find_partitions(NULL, NULL, 0, verbose_level);
+ } else if (flg == 'f') {
+ close(2);
+ return find_partitions( newlabel, device,
+ sizeof(device), verbose_level);
+ }
+
if (!newdev && !newlabel) {
printf("usage: mkqdisk -L | -f <label> | -c "
"<device> -l <label>\n");
More information about the cluster-commits
mailing list