From: Ulrich Drepper Date: Tue, 22 Apr 2008 15:53:59 +0000 (+0000) Subject: * nscd/Makefile (nscd-cflags): Set back to -fpie. X-Git-Tag: cvs/fedora-glibc-20080515T0735~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7eb5e6c9bdea71dc831862c5956d0bab08d92125;p=thirdparty%2Fglibc.git * nscd/Makefile (nscd-cflags): Set back to -fpie. * nscd/nscd.h (mem_in_flight): Add attribute_tls_model_ie. * nscd/connections.c (mem_in_flight): Likewise. * nscd/nscd.h (dbs): Make hidden. * sysdeps/unix/sysv/linux/times.c (__times): Fix check for EFAULT. Avoid returning -1, return 0 instead. --- diff --git a/ChangeLog b/ChangeLog index 6355676a5c2..c4b96f59776 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2008-04-22 Jakub Jelinek + + * nscd/Makefile (nscd-cflags): Set back to -fpie. + * nscd/nscd.h (mem_in_flight): Add attribute_tls_model_ie. + * nscd/connections.c (mem_in_flight): Likewise. + + * nscd/nscd.h (dbs): Make hidden. + + * sysdeps/unix/sysv/linux/times.c (__times): Fix check for EFAULT. + Avoid returning -1, return 0 instead. + 2008-04-19 Ulrich Drepper * resolv/res_mkquery.c (__res_nopt): Use NS_PUT16 instead of ns_put16. diff --git a/nscd/Makefile b/nscd/Makefile index 74df8247697..51badea2016 100644 --- a/nscd/Makefile +++ b/nscd/Makefile @@ -90,8 +90,7 @@ CFLAGS-nscd_initgroups.c = -fexceptions nscd-cflags = -DIS_IN_nscd=1 -D_FORTIFY_SOURCE=2 ifeq (yesyes,$(have-fpie)$(build-shared)) -#nscd-cflags += -fpie -nscd-cflags += -fpic +nscd-cflags += -fpie endif ifeq (yes,$(have-ssp)) nscd-cflags += -fstack-protector diff --git a/nscd/connections.c b/nscd/connections.c index 64c82cb8920..15148bdf3db 100644 --- a/nscd/connections.c +++ b/nscd/connections.c @@ -226,7 +226,7 @@ static int sock; unsigned long int client_queued; /* Data structure for recording in-flight memory allocation. */ -__thread struct mem_in_flight mem_in_flight; +__thread struct mem_in_flight mem_in_flight attribute_tls_model_ie; /* Global list of the mem_in_flight variables of all the threads. */ struct mem_in_flight *mem_in_flight_list; diff --git a/nscd/nscd.h b/nscd/nscd.h index cbea8e1a963..66813e74802 100644 --- a/nscd/nscd.h +++ b/nscd/nscd.h @@ -130,7 +130,7 @@ struct database_dyn /* Global variables. */ -extern struct database_dyn dbs[lastdb]; +extern struct database_dyn dbs[lastdb] attribute_hidden; extern const char *const dbnames[lastdb]; extern const char *const serv2str[LASTREQ]; @@ -201,7 +201,7 @@ extern __thread struct mem_in_flight } block[IDX_last]; struct mem_in_flight *next; -} mem_in_flight; +} mem_in_flight attribute_tls_model_ie; /* Global list of the mem_in_flight variables of all the threads. */ extern struct mem_in_flight *mem_in_flight_list; diff --git a/sysdeps/unix/sysv/linux/times.c b/sysdeps/unix/sysv/linux/times.c index 2759683b0b4..42d265dc873 100644 --- a/sysdeps/unix/sysv/linux/times.c +++ b/sysdeps/unix/sysv/linux/times.c @@ -27,7 +27,7 @@ __times (struct tms *buf) INTERNAL_SYSCALL_DECL (err); clock_t ret = INTERNAL_SYSCALL (times, err, 1, buf); if (INTERNAL_SYSCALL_ERROR_P (ret, err) - && __builtin_expect (INTERNAL_SYSCALL_ERRNO (ret, err) == -EFAULT, 0)) + && __builtin_expect (INTERNAL_SYSCALL_ERRNO (ret, err) == EFAULT, 0)) { /* This might be an error or not. For architectures which have no separate return value and error indicators we cannot @@ -49,6 +49,11 @@ __times (struct tms *buf) return an EFAULT error. Return the value given by the kernel. */ } + /* Return value (clock_t) -1 signals an error, but if there wasn't any, + return the following value. */ + if (ret == (clock_t) -1) + return (clock_t) 0; + return ret; } weak_alias (__times, times)