From b74a8485f4a8232a125d7e03e32ced2fc584e707 Mon Sep 17 00:00:00 2001 From: Keith Busch Date: Fri, 12 Apr 2019 14:48:29 -0600 Subject: [PATCH] Revert "plugin: Return EINVAL instead of ENOTTY" This reverts commit 048cd68c8f32c42b7098e1d21c06966f7fc6f099. The wrong help information is being printed, so just doing a simple revert to fix it. Signed-off-by: Keith Busch --- nvme.c | 2 +- plugin.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nvme.c b/nvme.c index 3cb359ad..102d5e9f 100644 --- a/nvme.c +++ b/nvme.c @@ -4964,7 +4964,7 @@ int main(int argc, char **argv) setlocale(LC_ALL, ""); ret = handle_plugin(argc - 1, &argv[1], nvme.extensions); - if (ret == -EINVAL) + if (ret == -ENOTTY) general_help(&builtin); return ret; diff --git a/plugin.c b/plugin.c index aa49501e..4750df6b 100644 --- a/plugin.c +++ b/plugin.c @@ -161,7 +161,7 @@ int handle_plugin(int argc, char **argv, struct plugin *plugin) /* Check extensions only if this is running the built-in plugin */ if (plugin->name) { printf("ERROR: Invalid sub-command '%s' for plugin %s\n", str, plugin->name); - return -EINVAL; + return -ENOTTY; } extension = plugin->next; @@ -184,5 +184,5 @@ int handle_plugin(int argc, char **argv, struct plugin *plugin) extension = extension->next; } printf("ERROR: Invalid sub-command '%s'\n", str); - return -EINVAL; + return -ENOTTY; } -- 2.50.1