From: Bernhard Voelker <mail@bernhard-voelker.de>
To: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Util-Linux <util-linux@vger.kernel.org>
Subject: Re: chcpu exit code?
Date: Fri, 28 Feb 2014 09:49:52 +0100 [thread overview]
Message-ID: <53104DB0.6030305@bernhard-voelker.de> (raw)
In-Reply-To: <20140228075355.GB4216@osiris>
On 02/28/2014 08:53 AM, Heiko Carstens wrote:
> 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?
Indeed, e.g. df(1) also fails if only a single mount point
cannot be listed. Otherwise, the calling script could not rely
on the exit code, and would still have to fall back to parsing
the output.
But thanks to your question I was reminded to have a look
at *where* chcpu writes messages:
$ chcpu -d 3-4 > /dev/null
$ chcpu -d 3-4 2> /dev/null
CPU 3 is already disabled
CPU 4 does not exist
$
I.e. chcpu does not write the error diagnostic to stderr ... humm.
Have a nice day,
Berny
next prev parent reply other threads:[~2014-02-28 8:49 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
2014-02-28 8:49 ` Bernhard Voelker [this message]
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=53104DB0.6030305@bernhard-voelker.de \
--to=mail@bernhard-voelker.de \
--cc=heiko.carstens@de.ibm.com \
--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