diff options
author | Ulrich Drepper <drepper@redhat.com> | 2007-10-14 09:15:45 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2007-10-14 09:15:45 +0000 |
commit | fa76dde2cf59865481793b9f233df74aa5c7d4c1 (patch) | |
tree | 909e9a417ad03e800b5be3a11a2a59e571b5722d /nscd | |
parent | 89dc9d4c5b50c4e6397d0d74d0570e88f09fca99 (diff) | |
download | glibc-fa76dde2cf59865481793b9f233df74aa5c7d4c1.zip glibc-fa76dde2cf59865481793b9f233df74aa5c7d4c1.tar.gz glibc-fa76dde2cf59865481793b9f233df74aa5c7d4c1.tar.bz2 |
* include/time.h: Declare __tzset_parse_tz and __tzset_compute.
* time/tzset.c (tzset_internal): Break TZ string parsing out into
__tzset_parse_tz and updating of daylight, timezone, tzname into
update_vars.
(__tz_compute): Renamed from tz_compute. Take additional parameters.
(__tz_convert): Updating of tm_isdst, tm_zone, and tm_gmtoff now
happens in __tz_compute.
* time/tzfile.c (__tzfile_read): Also read TZ string.
(find_transition): Fold into __tzfile_compute.
(__tzfile_compute): For times beyond the last transition try to
use the TZ string.
* timezone/tst-timezone.c: Information in daylight and tzname does
change for Asia/Tokyo timezone with more concrete information.
Remove the test.
* include/stdio.h: Add libc_hidden_proto for ftello.
* libio/ftello.c: Add libc_hidden_def.
Diffstat (limited to 'nscd')
-rw-r--r-- | nscd/nscd_getgr_r.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/nscd/nscd_getgr_r.c b/nscd/nscd_getgr_r.c index a277a1d..afb4d20 100644 --- a/nscd/nscd_getgr_r.c +++ b/nscd/nscd_getgr_r.c @@ -264,9 +264,9 @@ nscd_getgr_r (const char *key, size_t keylen, request_type type, retval = 0; /* If there are no group members TOTAL_LEN is zero. */ - if (total_len > 0) + if (gr_name == NULL) { - if (gr_name == NULL) + if (total_len > 0) { size_t n = __readall (sock, resultbuf->gr_mem[0], total_len); if (__builtin_expect (n != total_len, 0)) @@ -278,26 +278,26 @@ nscd_getgr_r (const char *key, size_t keylen, request_type type, else *result = resultbuf; } - else + } + else + { + /* Copy the group member names. */ + memcpy (resultbuf->gr_mem[0], gr_name + gr_name_len, total_len); + + /* Try to detect corrupt databases. */ + if (resultbuf->gr_name[gr_name_len - 1] != '\0' + || resultbuf->gr_passwd[gr_resp.gr_passwd_len - 1] != '\0' + || ({for (cnt = 0; cnt < gr_resp.gr_mem_cnt; ++cnt) + if (resultbuf->gr_mem[cnt][len[cnt] - 1] != '\0') + break; + cnt < gr_resp.gr_mem_cnt; })) { - /* Copy the group member names. */ - memcpy (resultbuf->gr_mem[0], gr_name + gr_name_len, total_len); - - /* Try to detect corrupt databases. */ - if (resultbuf->gr_name[gr_name_len - 1] != '\0' - || resultbuf->gr_passwd[gr_resp.gr_passwd_len - 1] != '\0' - || ({for (cnt = 0; cnt < gr_resp.gr_mem_cnt; ++cnt) - if (resultbuf->gr_mem[cnt][len[cnt] - 1] != '\0') - break; - cnt < gr_resp.gr_mem_cnt; })) - { - /* We cannot use the database. */ - retval = mapped->head->gc_cycle != gc_cycle ? -2 : -1; - goto out_close; - } - - *result = resultbuf; + /* We cannot use the database. */ + retval = mapped->head->gc_cycle != gc_cycle ? -2 : -1; + goto out_close; } + + *result = resultbuf; } } else |