summaryrefslogtreecommitdiff
path: root/gnulib
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2014-07-14 11:40:12 +0200
committerGuido Günther <agx@sigxcpu.org>2014-07-14 11:40:12 +0200
commitab710a4bc80b419b99089e71eb5b1a3e32adc7a5 (patch)
treef741889cf71bbdeb1f9f0097ab746f500a7e8f05 /gnulib
parent899c1d32fd12eda134f69c18255c96f6a428679b (diff)
New upstream version 1.2.6
Diffstat (limited to 'gnulib')
-rw-r--r--gnulib/lib/chown.c5
-rw-r--r--gnulib/lib/fcntl.in.h16
-rw-r--r--gnulib/lib/mbrtowc.c7
-rw-r--r--gnulib/tests/test-isnanl.h9
-rw-r--r--gnulib/tests/test-mbrtowc.c5
-rw-r--r--gnulib/tests/test-signbit.c10
-rw-r--r--gnulib/tests/xalloc.h2
7 files changed, 43 insertions, 11 deletions
diff --git a/gnulib/lib/chown.c b/gnulib/lib/chown.c
index e25d4814e..387554161 100644
--- a/gnulib/lib/chown.c
+++ b/gnulib/lib/chown.c
@@ -45,11 +45,6 @@ chown (const char *file _GL_UNUSED, uid_t uid _GL_UNUSED,
/* Below we refer to the system's chown(). */
# undef chown
-/* The results of open() in this file are not used with fchdir,
- therefore save some unnecessary work in fchdir.c. */
-# undef open
-# undef close
-
/* Provide a more-closely POSIX-conforming version of chown on
systems with one or both of the following problems:
- chown doesn't treat an ID of -1 as meaning
diff --git a/gnulib/lib/fcntl.in.h b/gnulib/lib/fcntl.in.h
index b69168f10..e77aa8a56 100644
--- a/gnulib/lib/fcntl.in.h
+++ b/gnulib/lib/fcntl.in.h
@@ -186,6 +186,22 @@ _GL_WARN_ON_USE (openat, "openat is not portable - "
/* Fix up the O_* macros. */
+/* AIX 7.1 with XL C 12.1 defines O_CLOEXEC, O_NOFOLLOW, and O_TTY_INIT
+ to values outside 'int' range, so omit these misdefinitions.
+ But avoid namespace pollution on non-AIX systems. */
+#ifdef _AIX
+# include <limits.h>
+# if defined O_CLOEXEC && ! (INT_MIN <= O_CLOEXEC && O_CLOEXEC <= INT_MAX)
+# undef O_CLOEXEC
+# endif
+# if defined O_NOFOLLOW && ! (INT_MIN <= O_NOFOLLOW && O_NOFOLLOW <= INT_MAX)
+# undef O_NOFOLLOW
+# endif
+# if defined O_TTY_INIT && ! (INT_MIN <= O_TTY_INIT && O_TTY_INIT <= INT_MAX)
+# undef O_TTY_INIT
+# endif
+#endif
+
#if !defined O_DIRECT && defined O_DIRECTIO
/* Tru64 spells it 'O_DIRECTIO'. */
# define O_DIRECT O_DIRECTIO
diff --git a/gnulib/lib/mbrtowc.c b/gnulib/lib/mbrtowc.c
index f4d580aa8..d31aaab91 100644
--- a/gnulib/lib/mbrtowc.c
+++ b/gnulib/lib/mbrtowc.c
@@ -328,7 +328,7 @@ mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
size_t
rpl_mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
{
-# if MBRTOWC_NULL_ARG2_BUG || MBRTOWC_RETVAL_BUG
+# if MBRTOWC_NULL_ARG2_BUG || MBRTOWC_RETVAL_BUG || MBRTOWC_EMPTY_INPUT_BUG
if (s == NULL)
{
pwc = NULL;
@@ -337,6 +337,11 @@ rpl_mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
}
# endif
+# if MBRTOWC_EMPTY_INPUT_BUG
+ if (n == 0)
+ return (size_t) -2;
+# endif
+
# if MBRTOWC_RETVAL_BUG
{
static mbstate_t internal_state;
diff --git a/gnulib/tests/test-isnanl.h b/gnulib/tests/test-isnanl.h
index eaf5da108..015b08649 100644
--- a/gnulib/tests/test-isnanl.h
+++ b/gnulib/tests/test-isnanl.h
@@ -51,6 +51,15 @@ main ()
/* A bit pattern that is different from a Quiet NaN. With a bit of luck,
it's a Signalling NaN. */
{
+#if defined __powerpc__ && LDBL_MANT_DIG == 106
+ /* This is PowerPC "double double", a pair of two doubles. Inf and Nan are
+ represented as the corresponding 64-bit IEEE values in the first double;
+ the second is ignored. Manipulate only the first double. */
+ #undef NWORDS
+ #define NWORDS \
+ ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+#endif
+
memory_long_double m;
m.value = NaNl ();
# if LDBL_EXPBIT0_BIT > 0
diff --git a/gnulib/tests/test-mbrtowc.c b/gnulib/tests/test-mbrtowc.c
index f64af4f40..e8cdea079 100644
--- a/gnulib/tests/test-mbrtowc.c
+++ b/gnulib/tests/test-mbrtowc.c
@@ -46,10 +46,7 @@ main (int argc, char *argv[])
memset (&state, '\0', sizeof (mbstate_t));
wc = (wchar_t) 0xBADFACE;
ret = mbrtowc (&wc, "x", 0, &state);
- /* gnulib's implementation returns (size_t)(-2).
- The AIX 5.1 implementation returns (size_t)(-1).
- glibc's implementation returns 0. */
- ASSERT (ret == (size_t)(-2) || ret == (size_t)(-1) || ret == 0);
+ ASSERT (ret == (size_t)(-2));
ASSERT (mbsinit (&state));
}
diff --git a/gnulib/tests/test-signbit.c b/gnulib/tests/test-signbit.c
index d3ebbd6ec..584bf4f91 100644
--- a/gnulib/tests/test-signbit.c
+++ b/gnulib/tests/test-signbit.c
@@ -151,6 +151,16 @@ test_signbitl ()
#define NWORDS \
((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
typedef union { long double value; unsigned int word[NWORDS]; } memory_long_double;
+
+#if defined __powerpc__ && LDBL_MANT_DIG == 106
+ /* This is PowerPC "double double", a pair of two doubles. Inf and Nan are
+ represented as the corresponding 64-bit IEEE values in the first double;
+ the second is ignored. Manipulate only the first double. */
+ #undef NWORDS
+ #define NWORDS \
+ ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+#endif
+
memory_long_double m;
m.value = zerol / zerol;
# if LDBL_EXPBIT0_BIT > 0
diff --git a/gnulib/tests/xalloc.h b/gnulib/tests/xalloc.h
index 0bd6bce81..3f6b5b80f 100644
--- a/gnulib/tests/xalloc.h
+++ b/gnulib/tests/xalloc.h
@@ -64,7 +64,7 @@ void *xrealloc (void *p, size_t s)
_GL_ATTRIBUTE_ALLOC_SIZE ((2));
void *x2realloc (void *p, size_t *pn);
void *xmemdup (void const *p, size_t s)
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_ALLOC_SIZE ((2));
+ _GL_ATTRIBUTE_ALLOC_SIZE ((2));
char *xstrdup (char const *str)
_GL_ATTRIBUTE_MALLOC;