[prev in list] [next in list] [prev in thread] [next in thread] 

List:       util-linux-ng
Subject:    Re: chcpu exit code?
From:       Karel Zak <kzak () redhat ! com>
Date:       2014-02-28 9:04:18
Message-ID: 20140228090418.GA2783 () x2 ! net ! home
[Download RAW message or body]

On Fri, Feb 28, 2014 at 08:53:55AM +0100, Heiko Carstens wrote:
> 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

 This is not so unusual situation, we have for example the same thing
 in mount -a where

   0 - success
  32 - mount failure
  64 - some mount succeeded

I think we can do something like this with chcpu, my suggestion is

   0 - success
   1 - failure
  64 - partial success

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic