From: Andre Prendel <andre_prendel@gmx.de>
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] [Patch] libsensors: Fix wrong behaviour in multiple
Date: Wed, 18 Feb 2009 08:20:08 +0000 [thread overview]
Message-ID: <20090218082008.GA4230@ubuntu> (raw)
The support for multiple configuration files causes a fatal error if
/etc/sensors.d does not exist.
That shouldn't be treated as an error. This patch fixes that.
--- lm-sensors-dev/lib/init.c 2009-02-16 14:12:50.000000000 +0100
+++ my-sensors/lib/init.c 2009-02-17 23:15:46.000000000 +0100
@@ -124,10 +124,15 @@ static int add_config_from_dir(const cha
struct dirent **namelist;
count = scandir(dir, &namelist, config_file_filter, alphasort);
+ /* Do not return an error if directory does not exist or is empty. */
if (count < 0) {
+ if (errno = ENOENT)
+ return 0;
+
sensors_parse_error_wfn(strerror(errno), NULL, 0);
return -SENSORS_ERR_PARSE;
- }
+ } else if (!count)
+ return 0;
for (res = 0, i = 0; !res && i < count; i++) {
int len;
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
next reply other threads:[~2009-02-18 8:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-18 8:20 Andre Prendel [this message]
2009-02-18 10:04 ` [lm-sensors] [Patch] libsensors: Fix wrong behaviour in Jean Delvare
2009-02-18 11:11 ` Andre Prendel
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=20090218082008.GA4230@ubuntu \
--to=andre_prendel@gmx.de \
--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.