From: Heiko Carstens <heiko.carstens@de.ibm.com>
To: Bernhard Voelker <mail@bernhard-voelker.de>
Cc: Util-Linux <util-linux@vger.kernel.org>
Subject: Re: chcpu exit code?
Date: Fri, 28 Feb 2014 08:53:55 +0100 [thread overview]
Message-ID: <20140228075355.GB4216@osiris> (raw)
In-Reply-To: <530F0972.3040205@bernhard-voelker.de>
On Thu, Feb 27, 2014 at 10:46:26AM +0100, Bernhard Voelker wrote:
> Although the man page does not mention the exit status, I think
> it's wrong that 'chcpu' exits OK when an action failed or
> when a bad CPU number was specified:
>
> $ ./chcpu -d 0 ; echo $?
> CPU 0 is not hot pluggable
> 0
>
> $ ./chcpu -g 3 ; echo $?
> CPU 3 is not configurable
> 0
>
> $ ./chcpu -e 4 ; echo $?
> CPU 4 does not exist
> 0
>
> WDYT?
The question is: what should chcpu return if it partially succeeded?
# chcpu -d 3-4
CPU 3 disabled
CPU 4 does not exist
If I remember correctly this was the reason to make it always return 0.
However, it is indeed valid to say if *everything* failed, it should
return an error. Hm?
next prev parent reply other threads:[~2014-02-28 7:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-27 9:46 chcpu exit code? Bernhard Voelker
2014-02-27 15:25 ` Dale R. Worley
2014-02-28 7:53 ` Heiko Carstens [this message]
2014-02-28 8:49 ` Bernhard Voelker
2014-02-28 9:04 ` Karel Zak
2014-03-03 11:23 ` Bernhard Voelker
2014-03-05 10:12 ` Karel Zak
2014-03-05 11:00 ` Bernhard Voelker
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=20140228075355.GB4216@osiris \
--to=heiko.carstens@de.ibm.com \
--cc=mail@bernhard-voelker.de \
--cc=util-linux@vger.kernel.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