summaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2004-09-30 09:05:55 +0000
committerJakub Jelinek <jakub@redhat.com>2004-09-30 09:05:55 +0000
commit6a87697239310dd529781d9db1ee705eeaa5405e (patch)
treed89bd4ede05cf7918178e39da5950535725717d8 /sysdeps
parentbd307f4e23f985b55276724a00f88e07309e68be (diff)
Updated to fedora-glibc-20040930T0838cvs/fedora-glibc-2_3_3-61
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/alpha/fpu/bits/mathinline.h8
-rw-r--r--sysdeps/generic/glob.c66
-rw-r--r--sysdeps/powerpc/fpu/bits/mathinline.h4
-rw-r--r--sysdeps/sparc/fpu/bits/mathinline.h4
-rw-r--r--sysdeps/unix/sysv/linux/ia64/bits/siginfo.h6
5 files changed, 63 insertions, 25 deletions
diff --git a/sysdeps/alpha/fpu/bits/mathinline.h b/sysdeps/alpha/fpu/bits/mathinline.h
index d3a76bad2b..187bd42f33 100644
--- a/sysdeps/alpha/fpu/bits/mathinline.h
+++ b/sysdeps/alpha/fpu/bits/mathinline.h
@@ -149,25 +149,25 @@ __MATH_INLINE double __NTH (floor (double __x)) { return __floor(__x); }
__MATH_INLINE float
__NTH (__fdimf (float __x, float __y))
{
- return __x < __y ? 0.0f : __x - __y;
+ return __x <= __y ? 0.0f : __x - __y;
}
__MATH_INLINE float
__NTH (fdimf (float __x, float __y))
{
- return __x < __y ? 0.0f : __x - __y;
+ return __x <= __y ? 0.0f : __x - __y;
}
__MATH_INLINE double
__NTH (__fdim (double __x, double __y))
{
- return __x < __y ? 0.0 : __x - __y;
+ return __x <= __y ? 0.0 : __x - __y;
}
__MATH_INLINE double
__NTH (fdim (double __x, double __y))
{
- return __x < __y ? 0.0 : __x - __y;
+ return __x <= __y ? 0.0 : __x - __y;
}
/* Test for negative number. Used in the signbit() macro. */
diff --git a/sysdeps/generic/glob.c b/sysdeps/generic/glob.c
index a6d6ada8bd..658599ec1f 100644
--- a/sysdeps/generic/glob.c
+++ b/sysdeps/generic/glob.c
@@ -1273,6 +1273,34 @@ weak_alias (__glob_pattern_p, glob_pattern_p)
#endif /* !GLOB_ONLY_P */
+/* We put this in a separate function mainly to allow the memory
+ allocated with alloca to be recycled. */
+#if !defined _LIBC || !defined GLOB_ONLY_P
+static int
+link_exists_p (const char *dir, size_t dirlen, const char *fname,
+ glob_t *pglob, int flags)
+{
+ size_t fnamelen = strlen (fname);
+ char *fullname = (char *) __alloca (dirlen + 1 + fnamelen + 1);
+ struct stat st;
+ struct stat64 st64;
+
+# ifdef HAVE_MEMPCPY
+ mempcpy (mempcpy (mempcpy (fullname, dir, dirlen), "/", 1),
+ fname, fnamelen + 1);
+# else
+ memcpy (fullname, dir, dirlen);
+ fullname[dirlen] = '/';
+ memcpy (&fullname[dirlen + 1], fname, fnamelen + 1);
+# endif
+
+ return (((flags & GLOB_ALTDIRFUNC)
+ ? (*pglob->gl_stat) (fullname, &st)
+ : __stat64 (fullname, &st64)) == 0);
+}
+#endif
+
+
/* Like `glob', but PATTERN is a final pathname component,
and matches are searched for in DIRECTORY.
The GLOB_NOSORT bit in FLAGS is ignored. No sorting is ever done.
@@ -1285,6 +1313,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
int (*errfunc) (const char *, int);
glob_t *pglob;
{
+ size_t dirlen = strlen (directory);
__ptr_t stream = NULL;
struct globlink
{
@@ -1315,7 +1344,6 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
struct stat64 st64;
# endif
size_t patlen = strlen (pattern);
- size_t dirlen = strlen (directory);
char *fullname = (char *) __alloca (dirlen + 1 + patlen + 1);
# ifdef HAVE_MEMPCPY
@@ -1428,22 +1456,32 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
if (fnmatch (pattern, name, fnm_flags) == 0)
{
- struct globlink *new = (struct globlink *)
- __alloca (sizeof (struct globlink));
- len = NAMLEN (d);
- new->name = (char *) malloc (len + 1);
- if (new->name == NULL)
- goto memory_error;
+ /* If the file we found is a symlink we have to
+ make sure the target file exists. */
+ if (
+#ifdef HAVE_D_TYPE
+ (d->d_type != DT_UNKNOWN && d->d_type != DT_LNK) ||
+#endif
+ link_exists_p (directory, dirlen, name, pglob,
+ flags))
+ {
+ struct globlink *new = (struct globlink *)
+ __alloca (sizeof (struct globlink));
+ len = NAMLEN (d);
+ new->name = (char *) malloc (len + 1);
+ if (new->name == NULL)
+ goto memory_error;
#ifdef HAVE_MEMPCPY
- *((char *) mempcpy ((__ptr_t) new->name, name, len))
- = '\0';
+ *((char *) mempcpy ((__ptr_t) new->name, name, len))
+ = '\0';
#else
- memcpy ((__ptr_t) new->name, name, len);
- new->name[len] = '\0';
+ memcpy ((__ptr_t) new->name, name, len);
+ new->name[len] = '\0';
#endif
- new->next = names;
- names = new;
- ++nfound;
+ new->next = names;
+ names = new;
+ ++nfound;
+ }
}
}
}
diff --git a/sysdeps/powerpc/fpu/bits/mathinline.h b/sysdeps/powerpc/fpu/bits/mathinline.h
index 491d529091..44f7dbec52 100644
--- a/sysdeps/powerpc/fpu/bits/mathinline.h
+++ b/sysdeps/powerpc/fpu/bits/mathinline.h
@@ -109,14 +109,14 @@ __MATH_INLINE double fdim (double __x, double __y) __THROW;
__MATH_INLINE double
__NTH (fdim (double __x, double __y))
{
- return __x < __y ? 0 : __x - __y;
+ return __x <= __y ? 0 : __x - __y;
}
__MATH_INLINE float fdimf (float __x, float __y) __THROW;
__MATH_INLINE float
__NTH (fdimf (float __x, float __y))
{
- return __x < __y ? 0 : __x - __y;
+ return __x <= __y ? 0 : __x - __y;
}
#endif /* __USE_ISOC99 */
diff --git a/sysdeps/sparc/fpu/bits/mathinline.h b/sysdeps/sparc/fpu/bits/mathinline.h
index 8811314278..2b578d04cd 100644
--- a/sysdeps/sparc/fpu/bits/mathinline.h
+++ b/sysdeps/sparc/fpu/bits/mathinline.h
@@ -223,14 +223,14 @@ __MATH_INLINE double fdim (double __x, double __y) __THROW;
__MATH_INLINE double
fdim (double __x, double __y) __THROW
{
- return __x < __y ? 0 : __x - __y;
+ return __x <= __y ? 0 : __x - __y;
}
__MATH_INLINE float fdimf (float __x, float __y) __THROW;
__MATH_INLINE float
fdimf (float __x, float __y) __THROW
{
- return __x < __y ? 0 : __x - __y;
+ return __x <= __y ? 0 : __x - __y;
}
# endif /* !__NO_MATH_INLINES */
diff --git a/sysdeps/unix/sysv/linux/ia64/bits/siginfo.h b/sysdeps/unix/sysv/linux/ia64/bits/siginfo.h
index 52d00e9da9..66310c65b3 100644
--- a/sysdeps/unix/sysv/linux/ia64/bits/siginfo.h
+++ b/sysdeps/unix/sysv/linux/ia64/bits/siginfo.h
@@ -122,11 +122,11 @@ typedef struct siginfo
# define si_band _sifields._sigpoll.si_band
# define si_fd _sifields._sigpoll.si_fd
-#ifdef __USE_GNU
+# ifdef __USE_GNU
# define si_imm _sifields._sigfault._si_imm
-# define si_flags _sifields._sigfault._si_flags
+# define si_segvflags _sifields._sigfault._si_flags
# define si_isr _sifields._sigfault._si_isr
-#endif
+# endif
/* Values for `si_code'. Positive values are reserved for kernel-generated
signals. */