mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-27 20:48:22 +00:00
Disable iconv when uclibc is used.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@3120 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
ca1432f131
commit
d2e6e8561b
1 file changed
+8
-1
+8
-1
@@ -24,7 +24,11 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#include <langinfo.h>
|
#include <langinfo.h>
|
||||||
|
|
||||||
|
#ifndef __UCLIBC__
|
||||||
#include <iconv.h>
|
#include <iconv.h>
|
||||||
|
#define HAVE_ICONV
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "lib/sensors.h"
|
#include "lib/sensors.h"
|
||||||
#include "lib/error.h"
|
#include "lib/error.h"
|
||||||
@@ -116,11 +120,13 @@ void close_config_file(const char* config_file_name)
|
|||||||
|
|
||||||
static void set_degstr(void)
|
static void set_degstr(void)
|
||||||
{
|
{
|
||||||
|
const char *deg_default_text[2] = {" C", " F"};
|
||||||
|
|
||||||
|
#ifdef HAVE_ICONV
|
||||||
/* Size hardcoded for better performance.
|
/* Size hardcoded for better performance.
|
||||||
Don't forget to count the trailing \0! */
|
Don't forget to count the trailing \0! */
|
||||||
size_t deg_latin1_size = 3;
|
size_t deg_latin1_size = 3;
|
||||||
char *deg_latin1_text[2] = {"\260C", "\260F"};
|
char *deg_latin1_text[2] = {"\260C", "\260F"};
|
||||||
const char *deg_default_text[2] = {" C", " F"};
|
|
||||||
size_t nconv;
|
size_t nconv;
|
||||||
size_t degstr_size = sizeof(degstr);
|
size_t degstr_size = sizeof(degstr);
|
||||||
char *degstr_ptr = degstr;
|
char *degstr_ptr = degstr;
|
||||||
@@ -134,6 +140,7 @@ static void set_degstr(void)
|
|||||||
if (nconv != (size_t) -1)
|
if (nconv != (size_t) -1)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#endif /* HAVE_ICONV */
|
||||||
|
|
||||||
/* There was an error during the conversion, use the default text */
|
/* There was an error during the conversion, use the default text */
|
||||||
strcpy(degstr, deg_default_text[fahrenheit]);
|
strcpy(degstr, deg_default_text[fahrenheit]);
|
||||||
|
|||||||
Reference in new issue
Block a user