]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
iw: document handler return value 1 as HANDLER_RET_USAGE
authorJohannes Berg <johannes.berg@intel.com>
Wed, 13 Apr 2016 11:47:19 +0000 (13:47 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 13 Apr 2016 11:48:26 +0000 (13:48 +0200)
This value is used to mean "print out usage info", so make
a define for it. Still not used, but new code can and should
use it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
iw.c
iw.h

diff --git a/iw.c b/iw.c
index fe394b2be74b76387a31319b3b6abfedee9bcd9e..2aabddb3c12005e67cb739a2c45a58b72630124e 100644 (file)
--- a/iw.c
+++ b/iw.c
@@ -570,7 +570,7 @@ int main(int argc, char **argv)
                err = __handle_cmd(&nlstate, idby, argc, argv, &cmd);
        }
 
-       if (err == 1) {
+       if (err == HANDLER_RET_USAGE) {
                if (cmd)
                        usage_cmd(cmd);
                else
diff --git a/iw.h b/iw.h
index b78e21b1aac8b0fec5822a1dac1218e71274f9a4..3ab260637db8b5c0ddedf486e09360f5e9b87e2c 100644 (file)
--- a/iw.h
+++ b/iw.h
@@ -38,6 +38,7 @@ enum id_input {
        II_WDEV,
 };
 
+#define HANDLER_RET_USAGE 1
 #define HANDLER_RET_DONE 3
 
 struct cmd {