FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 10-05-2011, 08:45 PM
Christophe Varoqui
 
Default 'multipath' with -h and -t option, it returns '1' (fail) for successful command execution

On mer., 2011-10-05 at 20:06 +0530, Aruna Balakrishnaiah wrote:
> Fix exit status for -h and -t options in multipath command
>
Merged.

Thanks for the effort to comply to the patch submission best practices.

cvaroqui

>
> ---
> multipath/main.c | 12 +++++++++---
> 1 files changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/multipath/main.c b/multipath/main.c
> index 654e031..9c45b8b 100644
> --- a/multipath/main.c
> +++ b/multipath/main.c
> @@ -116,7 +116,6 @@ usage (char * progname)
> " . multipath including the path with maj:min 'dev' (ex: 8:0)
"
> );
>
> - exit(1);
> }
>
> static int
> @@ -404,8 +403,10 @@ main (int argc, char *argv[])
> break;
> case 'v':
> if (sizeof(optarg) > sizeof(char *) ||
> - !isdigit(optarg[0]))
> + !isdigit(optarg[0])) {
> usage (argv[0]);
> + exit(1);
> + }
>
> conf->verbosity = atoi(optarg);
> break;
> @@ -445,24 +446,29 @@ main (int argc, char *argv[])
> if (conf->pgpolicy_flag == -1) {
> printf("'%s' is not a valid policy
", optarg);
> usage(argv[0]);
> + exit(1);
> }
> break;
> case 'r':
> conf->force_reload = 1;
> break;
> case 't':
> - dump_config();
> + r = dump_config();
> goto out;
> case 'h':
> usage(argv[0]);
> + exit(0);
> case ':':
> fprintf(stderr, "Missing option arguement
");
> usage(argv[0]);
> + exit(1);
> case '?':
> fprintf(stderr, "Unknown switch: %s
", optarg);
> usage(argv[0]);
> + exit(1);
> default:
> usage(argv[0]);
> + exit(1);
> }
> }
> if (optind < argc) {
>


--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 

Thread Tools




All times are GMT. The time now is 07:21 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org