Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=6e9... Commit: 6e92dab912882158b19c16971328dda3e0387e1d Parent: 81525d747202084fd878f27b51bba10156485467 Author: David Teigland teigland@redhat.com AuthorDate: Mon May 14 13:49:37 2012 -0500 Committer: David Teigland teigland@redhat.com CommitterDate: Mon May 14 13:49:37 2012 -0500
dlm_controld: fix command line with no options
Fix copy-paste error in command line arg processing that required argc > 1.
Signed-off-by: David Teigland teigland@redhat.com --- dlm_controld/main.c | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/dlm_controld/main.c b/dlm_controld/main.c index e8c8af3..c002520 100644 --- a/dlm_controld/main.c +++ b/dlm_controld/main.c @@ -1403,14 +1403,18 @@ struct dlm_option *get_dlm_option(char *name) static void set_opt_cli(int argc, char **argv) { struct dlm_option *o; - char *arg1 = argv[1]; - char *p, *arg_str; + char *arg1, *p, *arg_str; char bundled_letters[8]; int b, blc = 0, blc_max = 8; int debug_options = 0; int i, ind;
- if (argc < 2 || !strcmp(arg1, "help") || !strcmp(arg1, "--help") || !strcmp(arg1, "-h")) { + if (argc < 2) + return; + + arg1 = argv[1]; + + if (!strcmp(arg1, "help") || !strcmp(arg1, "--help") || !strcmp(arg1, "-h")) { print_usage(); exit(EXIT_SUCCESS); }
cluster-commits@lists.fedorahosted.org