From: Jean Delvare <khali@linux-fr.org>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [Patch] Fix exit code of the sensors tool
Date: Wed, 28 Jan 2009 13:10:25 +0000 [thread overview]
Message-ID: <20090128141025.35ae8ea1@hyperion.delvare> (raw)
In-Reply-To: <20090127090043.GA4479@ubuntu>
Hallo Andre,
On Tue, 27 Jan 2009 10:00:43 +0100, Andre Prendel wrote:
> This patch fixes the exit code of the sensors tool in error case
> (e.g. No sensors found).
>
> Error is set correctly, but at exit label exit() returns res instead
> of error.
Good catch, thanks for reporting. Not sure how I missed that.
> --- lm-sensors-dev/prog/sensors/main.c 2009-01-26 22:49:09.000000000 +0100
> +++ my-lm-sensors/prog/sensors/main.c 2009-01-26 22:19:06.000000000 +0100
> @@ -243,7 +243,7 @@
>
> int main(int argc, char *argv[])
> {
> - int c, res, i, error, do_bus_list;
> + int c, res, i, error = 0, do_bus_list;
> const char *config_file_name = NULL;
>
> struct option long_opts[] = {
> @@ -344,5 +344,5 @@
>
> exit:
> sensors_cleanup();
> - exit(res);
> + exit(error);
> }
Applied, thanks.
--
Jean Delvare
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
prev parent reply other threads:[~2009-01-28 13:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-27 9:00 [lm-sensors] [Patch] Fix exit code of the sensors tool Andre Prendel
2009-01-28 13:10 ` Jean Delvare [this message]
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=20090128141025.35ae8ea1@hyperion.delvare \
--to=khali@linux-fr.org \
--cc=lm-sensors@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.