Re: chcpu exit code?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux