From c164cf038c522d153bf9ac6c4bddabe0be81a7e1 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Thu, 8 Apr 2010 10:33:09 +0200 Subject: confstr: properly stringify version parts Signed-off-by: Bernhard Reutner-Fischer --- libc/unistd/confstr.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'libc') diff --git a/libc/unistd/confstr.c b/libc/unistd/confstr.c index 957ee4d27..fc0bd599e 100644 --- a/libc/unistd/confstr.c +++ b/libc/unistd/confstr.c @@ -52,11 +52,13 @@ size_t confstr (int name, char *buf, size_t len) string_len = sizeof("linuxthreads-x.xx"); # elif defined __UCLIBC_HAS_THREADS_NATIVE__ # define __NPTL_VERSION ("NPTL " \ - #__UCLIBC_MAJOR__ "." \ - #__UCLIBC_MINOR__ "." \ - #__UCLIBC_SUBLEVEL__) + __stringify(__UCLIBC_MAJOR__) "." \ + __stringify(__UCLIBC_MINOR__) "." \ + __stringify(__UCLIBC_SUBLEVEL__)) string = __NPTL_VERSION; string_len = sizeof(__NPTL_VERSION); +# else +# error unable to determine thread impl # endif break; #endif -- cgit v1.2.3 From eda86005f81342094c211ba13c8128afcff98f5d Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 9 Apr 2010 23:17:34 +0200 Subject: resolv: tentatively fix usage of uninitialized DNS parameters See "Possible regression from timeout commit for resolv.conf" thread. Also remove superfluous NULL check. Signed-off-by: Denys Vlasenko --- libc/inet/resolv.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'libc') diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c index 9459199da..84289a619 100644 --- a/libc/inet/resolv.c +++ b/libc/inet/resolv.c @@ -905,8 +905,8 @@ __UCLIBC_MUTEX_INIT(__resolv_lock, PTHREAD_MUTEX_INITIALIZER); /* Protected by __resolv_lock */ void (*__res_sync)(void); /*uint32_t __resolv_opts; */ -uint8_t __resolv_timeout; -uint8_t __resolv_attempts; +uint8_t __resolv_timeout = RES_TIMEOUT; +uint8_t __resolv_attempts = RES_DFLRETRY; unsigned __nameservers; unsigned __searchdomains; sockaddr46_t *__nameserver; @@ -1062,8 +1062,6 @@ void attribute_hidden __open_nameservers(void) if (p == NULL || (p1 = strchr(p, ':')) == NULL) continue; *p1++ = '\0'; - if (p1 == NULL) - continue; if (strcmp(p, "timeout") == 0) what = &__resolv_timeout; else if (strcmp(p, "attempts") == 0) -- cgit v1.2.3 From 62174f7330a4578faf2df6c108c0ee6ee5270325 Mon Sep 17 00:00:00 2001 From: Carmelo Amoroso Date: Mon, 12 Apr 2010 09:23:43 +0200 Subject: libc_regex: __libc_lock primitives are actually available on uClibc __libc_lock primitives are actually available on uClibc when threading support is enable, so in this case they can be used. It also fixes the following compiler warnings: In file included from libc/misc/regex/regex.c:55: libc/misc/regex/regex_internal.h:49:1: warning: "__libc_lock_define" redefined [SNIP] libc/misc/regex/regex_internal.h:50:1: warning: "__libc_lock_init" redefined [SNIP] libc/misc/regex/regex_internal.h:51:1: warning: "__libc_lock_lock" redefined [SNIP] libc/misc/regex/regex_internal.h:52:1: warning: "__libc_lock_unlock" redefined Signed-off-by: Carmelo Amoroso (cherry picked from commit 65f9ccdafd008abd9892dfc46fb9737ec4d964c5) Signed-off-by: Carmelo Amoroso --- libc/misc/regex/regex_internal.h | 4 ++++ libc/misc/regex/regexec.c | 5 ++--- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'libc') diff --git a/libc/misc/regex/regex_internal.h b/libc/misc/regex/regex_internal.h index 03f08bf52..0a255e37f 100644 --- a/libc/misc/regex/regex_internal.h +++ b/libc/misc/regex/regex_internal.h @@ -46,10 +46,14 @@ # include #endif +#ifdef __UCLIBC_HAS_THREADS__ +#include +#else #define __libc_lock_define(CLASS, NAME) #define __libc_lock_init(NAME) do { } while (0) #define __libc_lock_lock(NAME) do { } while (0) #define __libc_lock_unlock(NAME) do { } while (0) +#endif #undef gettext #undef gettext_noop diff --git a/libc/misc/regex/regexec.c b/libc/misc/regex/regexec.c index 92cbd821a..568108a67 100644 --- a/libc/misc/regex/regexec.c +++ b/libc/misc/regex/regexec.c @@ -222,7 +222,7 @@ regexec (preg, string, nmatch, pmatch, eflags) { reg_errcode_t err; int start, length; -#ifndef __UCLIBC__ /* libc_lock_lock does not exist */ +#ifdef __UCLIBC_HAS_THREADS__ re_dfa_t *dfa = (re_dfa_t *) preg->buffer; #endif @@ -382,10 +382,9 @@ re_search_stub (bufp, string, length, start, range, stop, regs, ret_len) regmatch_t *pmatch; int nregs, rval; int eflags = 0; -#ifndef __UCLIBC__ /* libc_lock_lock does not exist */ +#ifdef __UCLIBC_HAS_THREADS__ re_dfa_t *dfa = (re_dfa_t *) bufp->buffer; #endif - /* Check for out-of-range. */ if (BE (start < 0 || start > length, 0)) return -1; -- cgit v1.2.3