From: khali@linux-fr.org (Jean Delvare)
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] sensors with uclibc (without iconv)
Date: Fri, 07 Oct 2005 19:56:11 +0000 [thread overview]
Message-ID: <20051007195453.0844cfea.khali@linux-fr.org> (raw)
Hi Bela, Rene, Robert,
It seems that you all would like sensors to compile on uclibc-based
systems, where iconv is not available. Attached is a patch which does
just that. It's basically the same as Rene proposed in ticket #2049,
except that detection is automatic. Please test. If it is actually OK
I'll apply it to lm_sensors CVS.
Thanks,
--
Jean Delvare
-------------- next part --------------
? prog/sensors/chips.rd
? prog/sensors/chips.ro
? prog/sensors/main.rd
? prog/sensors/main.ro
? prog/sensors/sensors
Index: prog/sensors/main.c
=================================RCS file: /home/cvs/lm_sensors2/prog/sensors/main.c,v
retrieving revision 1.112
diff -u -r1.112 main.c
--- prog/sensors/main.c 25 Sep 2005 13:31:53 -0000 1.112
+++ prog/sensors/main.c 7 Oct 2005 17:42:23 -0000
@@ -24,7 +24,11 @@
#include <errno.h>
#include <locale.h>
#include <langinfo.h>
+
+#ifndef __UCLIBC__
#include <iconv.h>
+#define HAVE_ICONV
+#endif
#include "lib/sensors.h"
#include "lib/error.h"
@@ -116,11 +120,13 @@
static void set_degstr(void)
{
+ const char *deg_default_text[2] = {" C", " F"};
+
+#ifdef HAVE_ICONV
/* Size hardcoded for better performance.
Don't forget to count the trailing \0! */
size_t deg_latin1_size = 3;
char *deg_latin1_text[2] = {"\260C", "\260F"};
- const char *deg_default_text[2] = {" C", " F"};
size_t nconv;
size_t degstr_size = sizeof(degstr);
char *degstr_ptr = degstr;
@@ -134,6 +140,7 @@
if (nconv != (size_t) -1)
return;
}
+#endif /* HAVE_ICONV */
/* There was an error during the conversion, use the default text */
strcpy(degstr, deg_default_text[fahrenheit]);
next reply other threads:[~2005-10-07 19:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-07 19:56 Jean Delvare [this message]
2005-10-14 18:47 ` [lm-sensors] Re: sensors with uclibc (without iconv) Jean Delvare
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=20051007195453.0844cfea.khali@linux-fr.org \
--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.