netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] man: fix doc ip will exit with -1
@ 2024-04-23  7:03 Jiayun Chen
  2024-04-23 15:35 ` Stephen Hemminger
  2024-04-27 16:42 ` Stephen Hemminger
  0 siblings, 2 replies; 4+ messages in thread
From: Jiayun Chen @ 2024-04-23  7:03 UTC (permalink / raw)
  To: netdev; +Cc: shemminger, Jiayun Chen

The exit code of -1 (255) is not documented:

$ ip link set dev; echo $?
255

$ ip route help; echo $?
255

It appears that ip returns -1 on syntax error, e.g., invalid device, buffer
size. Here is a patch for documenting this behavior.

Signed-off-by: Jiayun Chen <chenjiayunju@gmail.com>
---
 man/man8/ip.8 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/man/man8/ip.8 b/man/man8/ip.8
index fdae57c5..e7bd9eb4 100644
--- a/man/man8/ip.8
+++ b/man/man8/ip.8
@@ -405,8 +405,8 @@ If this value is 0-6 or 8, chose colors suitable for dark background:
 COLORFGBG=";0" ip -c a
 
 .SH EXIT STATUS
-Exit status is 0 if command was successful, and 1 if there is a syntax error.
-If an error was reported by the kernel exit status is 2.
+Exit status is 0 if command was successful, and -1 or 1 if there is a 
+syntax error. If an error was reported by the kernel exit status is 2.
 
 .SH "EXAMPLES"
 .PP
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-04-27 16:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-23  7:03 [PATCH] man: fix doc ip will exit with -1 Jiayun Chen
2024-04-23 15:35 ` Stephen Hemminger
2024-04-24 13:43   ` jiayun chen
2024-04-27 16:42 ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).