From 6e4c40baacfd7eaf1578f707759d79b5d95d626c Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 9 Sep 1998 11:53:19 +0000 Subject: Update. 1998-09-09 09:32 Ulrich Drepper * sysdeps/powerpc/dl-machine.h (elf_machine_rela): Make function inline. 1998-09-07 Paul Eggert * time/mktime.c (__EXTENSIONS__): Define if not defined. (_REENTRANT): Remove. It has undesirable consequences in Solaris 2.6 (e.g. it turns off the putc macro). Defining __EXTENSIONS__ makes localtime_r and gmtime_r visible, which is what we want. * time/strftime.c: Likewise. 1998-09-08 Andreas Schwab * elf/dl-error.c: Fix spelling. 1998-09-08 Andreas Schwab * stdlib/strfmon.c: Quiet -Wparentheses warnings. * stdio-common/_itoa.c: Likewise. * stdio-common/printf_fp.c: Likewise. * stdio-common/vfscanf.c: Likewise. * wcsmbs/wcstok.c: Likewise. * sysdeps/generic/glob.c: Likewise. * posix/getopt.c: Likewise. * sysdeps/posix/getaddrinfo.c: Likewise. * posix/wordexp.c: Likewise. * io/ftw.c: Likewise. * io/fts.c: Likewise. * misc/getpass.c: Likewise. * iconv/gconv_conf.c: Likewise. * argp/argp-fmtstream.c: Likewise. * argp/argp-help.c: Likewise. * elf/dl-load.c: Likewise. * locale/programs/stringtrans.c: Likewise. * catgets/gencat.c: Likewise. * posix/getconf.c: Likewise. * iconv/gconv_conf.c: Likewise. * iconv/iconv_prog.c: Likewise. * string/strcoll.c: Optimize a few expressions. * string/strxfrm.c: Likewise. 1998-09-08 Andreas Schwab * elf/dl-open.c (dl_open_worker): Move decl of new_global up one level to avoid uninit variable warning. 1998-09-09 10:34 Andreas Schwab instead of _dl_default_scope[2] as argument to _dl_init_next. Fix compatibility problems introduced in last change. --- sysdeps/generic/glob.c | 150 ++++++++++++++++++++++--------------------- sysdeps/posix/getaddrinfo.c | 10 +-- sysdeps/powerpc/dl-machine.h | 2 +- 3 files changed, 85 insertions(+), 77 deletions(-) (limited to 'sysdeps') diff --git a/sysdeps/generic/glob.c b/sysdeps/generic/glob.c index c41d03f8b2..e50963e9c4 100644 --- a/sysdeps/generic/glob.c +++ b/sysdeps/generic/glob.c @@ -659,10 +659,12 @@ glob (pattern, flags, errfunc, pglob) } } if (home_dir == NULL || home_dir[0] == '\0') - if (flags & GLOB_TILDE_CHECK) - return GLOB_NOMATCH; - else - home_dir = "~"; /* No luck. */ + { + if (flags & GLOB_TILDE_CHECK) + return GLOB_NOMATCH; + else + home_dir = "~"; /* No luck. */ + } # endif /* WINDOWS32 */ # endif /* Now construct the full directory. */ @@ -882,78 +884,80 @@ glob (pattern, flags, errfunc, pglob) flag was set we must return the list consisting of the disrectory names followed by the filename. */ if (pglob->gl_pathc == oldcount) - /* No matches. */ - if (flags & GLOB_NOCHECK) - { - size_t filename_len = strlen (filename) + 1; - char **new_pathv; - struct stat st; - - /* This is an pessimistic guess about the size. */ - pglob->gl_pathv - = (char **) realloc (pglob->gl_pathv, - (pglob->gl_pathc + - ((flags & GLOB_DOOFFS) ? - pglob->gl_offs : 0) + - dirs.gl_pathc + 1) * - sizeof (char *)); - if (pglob->gl_pathv == NULL) - { - globfree (&dirs); - return GLOB_NOSPACE; - } + { + /* No matches. */ + if (flags & GLOB_NOCHECK) + { + size_t filename_len = strlen (filename) + 1; + char **new_pathv; + struct stat st; + + /* This is an pessimistic guess about the size. */ + pglob->gl_pathv + = (char **) realloc (pglob->gl_pathv, + (pglob->gl_pathc + + ((flags & GLOB_DOOFFS) ? + pglob->gl_offs : 0) + + dirs.gl_pathc + 1) * + sizeof (char *)); + if (pglob->gl_pathv == NULL) + { + globfree (&dirs); + return GLOB_NOSPACE; + } - if (flags & GLOB_DOOFFS) - while (pglob->gl_pathc < pglob->gl_offs) - pglob->gl_pathv[pglob->gl_pathc++] = NULL; + if (flags & GLOB_DOOFFS) + while (pglob->gl_pathc < pglob->gl_offs) + pglob->gl_pathv[pglob->gl_pathc++] = NULL; - for (i = 0; i < dirs.gl_pathc; ++i) - { - const char *dir = dirs.gl_pathv[i]; - size_t dir_len = strlen (dir); - - /* First check whether this really is a directory. */ - if (((flags & GLOB_ALTDIRFUNC) - ? (*pglob->gl_stat) (dir, &st) : __stat (dir, &st)) != 0 - || !S_ISDIR (st.st_mode)) - /* No directory, ignore this entry. */ - continue; - - pglob->gl_pathv[pglob->gl_pathc] = malloc (dir_len + 1 - + filename_len); - if (pglob->gl_pathv[pglob->gl_pathc] == NULL) - { - globfree (&dirs); - globfree (pglob); - return GLOB_NOSPACE; - } + for (i = 0; i < dirs.gl_pathc; ++i) + { + const char *dir = dirs.gl_pathv[i]; + size_t dir_len = strlen (dir); + + /* First check whether this really is a directory. */ + if (((flags & GLOB_ALTDIRFUNC) + ? (*pglob->gl_stat) (dir, &st) : __stat (dir, &st)) != 0 + || !S_ISDIR (st.st_mode)) + /* No directory, ignore this entry. */ + continue; + + pglob->gl_pathv[pglob->gl_pathc] = malloc (dir_len + 1 + + filename_len); + if (pglob->gl_pathv[pglob->gl_pathc] == NULL) + { + globfree (&dirs); + globfree (pglob); + return GLOB_NOSPACE; + } #ifdef HAVE_MEMPCPY - mempcpy (mempcpy (mempcpy (pglob->gl_pathv[pglob->gl_pathc], - dir, dir_len), - "/", 1), - filename, filename_len); + mempcpy (mempcpy (mempcpy (pglob->gl_pathv[pglob->gl_pathc], + dir, dir_len), + "/", 1), + filename, filename_len); #else - memcpy (pglob->gl_pathv[pglob->gl_pathc], dir, dir_len); - pglob->gl_pathv[pglob->gl_pathc][dir_len] = '/'; - memcpy (&pglob->gl_pathv[pglob->gl_pathc][dir_len + 1], - filename, filename_len); + memcpy (pglob->gl_pathv[pglob->gl_pathc], dir, dir_len); + pglob->gl_pathv[pglob->gl_pathc][dir_len] = '/'; + memcpy (&pglob->gl_pathv[pglob->gl_pathc][dir_len + 1], + filename, filename_len); #endif - ++pglob->gl_pathc; - } + ++pglob->gl_pathc; + } - pglob->gl_pathv[pglob->gl_pathc] = NULL; - pglob->gl_flags = flags; + pglob->gl_pathv[pglob->gl_pathc] = NULL; + pglob->gl_flags = flags; - /* Now we know how large the gl_pathv vector must be. */ - new_pathv = (char **) realloc (pglob->gl_pathv, - ((pglob->gl_pathc + 1) - * sizeof (char *))); - if (new_pathv != NULL) - pglob->gl_pathv = new_pathv; - } - else - return GLOB_NOMATCH; + /* Now we know how large the gl_pathv vector must be. */ + new_pathv = (char **) realloc (pglob->gl_pathv, + ((pglob->gl_pathc + 1) + * sizeof (char *))); + if (new_pathv != NULL) + pglob->gl_pathv = new_pathv; + } + else + return GLOB_NOMATCH; + } globfree (&dirs); } @@ -1352,10 +1356,12 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob) save = errno; if (stream != NULL) - if (flags & GLOB_ALTDIRFUNC) - (*pglob->gl_closedir) (stream); - else - closedir ((DIR *) stream); + { + if (flags & GLOB_ALTDIRFUNC) + (*pglob->gl_closedir) (stream); + else + closedir ((DIR *) stream); + } __set_errno (save); return nfound == 0 ? GLOB_NOMATCH : 0; diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c index 30cc6364e7..7502e00e6a 100644 --- a/sysdeps/posix/getaddrinfo.c +++ b/sysdeps/posix/getaddrinfo.c @@ -283,10 +283,12 @@ gaih_inet (const char *name, const struct gaih_service *service, ((req->ai_socktype != tp->socktype) || !req->ai_socktype) && ((req->ai_protocol != tp->protocol) || !req->ai_protocol); tp++); if (tp->name == NULL) - if (req->ai_socktype) - return (GAIH_OKIFUNSPEC | -EAI_SOCKTYPE); - else - return (GAIH_OKIFUNSPEC | -EAI_SERVICE); + { + if (req->ai_socktype) + return (GAIH_OKIFUNSPEC | -EAI_SOCKTYPE); + else + return (GAIH_OKIFUNSPEC | -EAI_SERVICE); + } } if (service != NULL) diff --git a/sysdeps/powerpc/dl-machine.h b/sysdeps/powerpc/dl-machine.h index bb449a9d34..ce6fcd02ab 100644 --- a/sysdeps/powerpc/dl-machine.h +++ b/sysdeps/powerpc/dl-machine.h @@ -278,7 +278,7 @@ extern void __process_machine_rela (struct link_map *map, LOADADDR is the load address of the object; INFO is an array indexed by DT_* of the .dynamic section info. */ -extern void +inline void elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, const Elf32_Sym *sym, const struct r_found_version *version, Elf32_Addr *const reloc_addr) -- cgit 1.4.1