[Pm-utils] [PATCH 14/17] Remove redundant exit call from 95led
victor.lowther at gmail.com
Fri Feb 15 05:28:32 PST 2008
On Fri, Feb 15, 2008 at 09:07:19AM +0100, Michael Biebl wrote:
> 2008/2/15, Victor Lowther <victor.lowther at gmail.com>:
> > -[ -f /proc/acpi/ibm/led ] || exit 1
> I like explicitly returning 1, because you immediately see, that we
> return 1 in case we don't find the required resource. (This comment is
> true for #13, #11, #9, #7, #6)
However, nothing in pm-utils notices or cares what the hooks return
right now. It used to, but the refactoring I performed on run_hooks a
couple of patch series ago got rid of that.
> > +[ -f /proc/acpi/ibm/led ] || exit
> This is imho harder to read and understand. So I vote against removing
> the explicit "exit 1".
> > case "$1" in
> > thaw|resume)
> > @@ -9,5 +9,3 @@ case "$1" in
> > *)
> > ;;
> > esac
> > -
> > -exit $?
> Instead of exit $?, I'd say we should return 0 here. So we have a
> defined return code of 0, when we have reached the end of the script.
Well, this script will exit with 0 by default anyways, so I figured that
making it explicitly exit with 0 was redundant.
> Why is it that all of the instruments seeking intelligent life in the
> universe are pointed away from Earth?
Ubuntu Certified Professional
More information about the Pm-utils