diff mbox

[2/2] ndctl: fix return value for disable-namespace

Message ID 1478726177-21904-2-git-send-email-ross.zwisler@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ross Zwisler Nov. 9, 2016, 9:16 p.m. UTC
On success the "ndctl disable-namespace" returns the number of namespaces
that were disabled to the shell as an exit value.  This non-zero value is
interpreted by the shell as an error.

Fix this by returning 0 on success, just like all the other ndctl commands.

Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
---
 ndctl/builtin-xaction-namespace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Dan Williams Nov. 9, 2016, 11:47 p.m. UTC | #1
On Wed, Nov 9, 2016 at 1:16 PM, Ross Zwisler
<ross.zwisler@linux.intel.com> wrote:
> On success the "ndctl disable-namespace" returns the number of namespaces
> that were disabled to the shell as an exit value.  This non-zero value is
> interpreted by the shell as an error.
>
> Fix this by returning 0 on success, just like all the other ndctl commands.
>
> Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
> ---
>  ndctl/builtin-xaction-namespace.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/ndctl/builtin-xaction-namespace.c b/ndctl/builtin-xaction-namespace.c
> index 9b1702d..c556252 100644
> --- a/ndctl/builtin-xaction-namespace.c
> +++ b/ndctl/builtin-xaction-namespace.c
> @@ -790,7 +790,7 @@ int cmd_disable_namespace(int argc, const char **argv, struct ndctl_ctx *ctx)
>         } else {
>                 fprintf(stderr, "disabled %d namespace%s\n", disabled,
>                                 disabled > 1 ? "s" : "");
> -               return disabled;
> +               return 0;
>         }
>  }
>
> --
> 2.7.4
>

Thanks Ross. Applied.
diff mbox

Patch

diff --git a/ndctl/builtin-xaction-namespace.c b/ndctl/builtin-xaction-namespace.c
index 9b1702d..c556252 100644
--- a/ndctl/builtin-xaction-namespace.c
+++ b/ndctl/builtin-xaction-namespace.c
@@ -790,7 +790,7 @@  int cmd_disable_namespace(int argc, const char **argv, struct ndctl_ctx *ctx)
 	} else {
 		fprintf(stderr, "disabled %d namespace%s\n", disabled,
 				disabled > 1 ? "s" : "");
-		return disabled;
+		return 0;
 	}
 }