]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
Revert "plugin: Return EINVAL instead of ENOTTY"
authorKeith Busch <keith.busch@intel.com>
Fri, 12 Apr 2019 20:48:29 +0000 (14:48 -0600)
committerKeith Busch <keith.busch@intel.com>
Fri, 12 Apr 2019 20:48:51 +0000 (14:48 -0600)
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 <keith.busch@intel.com>
nvme.c
plugin.c

diff --git a/nvme.c b/nvme.c
index 3cb359ad595149570d9858cbe28575a90dc2adca..102d5e9f0ab3c9d7fdc5ed0b4d4bb95c9e74ed28 100644 (file)
--- 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;
index aa49501ec76308056de02cf37adcc85998fa1c96..4750df6bd50b68f2d16d8d645f1572d34057d5ee 100644 (file)
--- 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;
 }