netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Jiayun Chen <chenjiayunju@gmail.com>
Cc: netdev@vger.kernel.org, shemminger@osdl.org
Subject: Re: [PATCH] man: fix doc ip will exit with -1
Date: Sat, 27 Apr 2024 09:42:17 -0700	[thread overview]
Message-ID: <20240427094217.28b5314c@hermes.local> (raw)
In-Reply-To: <20240423070345.508758-1-chenjiayunju@gmail.com>

On Tue, 23 Apr 2024 15:03:46 +0800
Jiayun Chen <chenjiayunju@gmail.com> wrote:

> 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>
> ---

I would rather fix all of iproute2 commands (ip, bridge, tc, devlink, etc)
to follow the conventions used by other Linux utilities of return 2 for errors
in command line arguments. Doing that is unlikely to break any scripts because
a sane script will be checking for exit status of non-zero.


      parent reply	other threads:[~2024-04-27 16:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240427094217.28b5314c@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=chenjiayunju@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).