summaryrefslogtreecommitdiff
path: root/lgl
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2008-01-31 10:14:21 +0100
committerSimon Josefsson <simon@josefsson.org>2008-01-31 10:14:21 +0100
commitdb06630d32de8e8fd02a4f10233628c4eba73b47 (patch)
tree4b261b8bbecbd3d4f36906751806346e65a85cb4 /lgl
parent84dbba089ff08548f3c7a26bf2590fa160d1ada8 (diff)
downloadgnutls-db06630d32de8e8fd02a4f10233628c4eba73b47.tar.gz
Update gnulib files.
Diffstat (limited to 'lgl')
-rw-r--r--lgl/Makefile.am2
-rw-r--r--lgl/m4/unistd_h.m44
-rw-r--r--lgl/unistd.in.h14
-rw-r--r--lgl/vasnprintf.c18
4 files changed, 28 insertions, 10 deletions
diff --git a/lgl/Makefile.am b/lgl/Makefile.am
index a545762b05..d63b3dd98f 100644
--- a/lgl/Makefile.am
+++ b/lgl/Makefile.am
@@ -646,6 +646,7 @@ unistd.h: unistd.in.h
-e 's|@''GNULIB_FCHDIR''@|$(GNULIB_FCHDIR)|g' \
-e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \
-e 's|@''GNULIB_GETCWD''@|$(GNULIB_GETCWD)|g' \
+ -e 's|@''GNULIB_GETHOSTNAME''@|$(GNULIB_GETHOSTNAME)|g' \
-e 's|@''GNULIB_GETLOGIN_R''@|$(GNULIB_GETLOGIN_R)|g' \
-e 's|@''GNULIB_GETPAGESIZE''@|$(GNULIB_GETPAGESIZE)|g' \
-e 's|@''GNULIB_LCHOWN''@|$(GNULIB_LCHOWN)|g' \
@@ -657,6 +658,7 @@ unistd.h: unistd.in.h
-e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \
-e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \
-e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \
+ -e 's|@''HAVE_DECL_GETHOSTNAME''@|$(HAVE_DECL_GETHOSTNAME)|g' \
-e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \
-e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \
-e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \
diff --git a/lgl/m4/unistd_h.m4 b/lgl/m4/unistd_h.m4
index 4b8857ca5b..daf7677886 100644
--- a/lgl/m4/unistd_h.m4
+++ b/lgl/m4/unistd_h.m4
@@ -1,5 +1,5 @@
# unistd_h.m4 serial 10
-dnl Copyright (C) 2006-2007 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2008 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -37,6 +37,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
GNULIB_FCHDIR=0; AC_SUBST([GNULIB_FCHDIR])
GNULIB_FTRUNCATE=0; AC_SUBST([GNULIB_FTRUNCATE])
GNULIB_GETCWD=0; AC_SUBST([GNULIB_GETCWD])
+ GNULIB_GETHOSTNAME=0; AC_SUBST([GNULIB_GETHOSTNAME])
GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R])
GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE])
GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN])
@@ -49,6 +50,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
HAVE_GETPAGESIZE=1; AC_SUBST([HAVE_GETPAGESIZE])
HAVE_READLINK=1; AC_SUBST([HAVE_READLINK])
HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP])
+ HAVE_DECL_GETHOSTNAME=1;AC_SUBST([HAVE_DECL_GETHOSTNAME])
HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R])
HAVE_OS_H=0; AC_SUBST([HAVE_OS_H])
HAVE_SYS_PARAM_H=0; AC_SUBST([HAVE_SYS_PARAM_H])
diff --git a/lgl/unistd.in.h b/lgl/unistd.in.h
index 10678f4c99..ae6919cd50 100644
--- a/lgl/unistd.in.h
+++ b/lgl/unistd.in.h
@@ -1,5 +1,5 @@
/* Substitute for and wrapper around <unistd.h>.
- Copyright (C) 2004-2007 Free Software Foundation, Inc.
+ Copyright (C) 2004-2008 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@@ -156,6 +156,18 @@ extern char * getcwd (char *buf, size_t size);
getcwd (b, s))
#endif
+#if @GNULIB_GETHOSTNAME@
+# if !@HAVE_DECL_GETHOSTNAME@
+# include <stddef.h>
+ extern int gethostname (char *name, size_t size);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef gethostname
+# define gethostname(n,s) \
+ (GL_LINK_WARNING ("gethostname is unportable - " \
+ "use gnulib module gethostname for portability"), \
+ gethostname (n, s))
+#endif
#if @GNULIB_GETLOGIN_R@
/* Copies the user's login name to NAME.
diff --git a/lgl/vasnprintf.c b/lgl/vasnprintf.c
index 6c8d5dcbdc..205a9bfd22 100644
--- a/lgl/vasnprintf.c
+++ b/lgl/vasnprintf.c
@@ -1,5 +1,5 @@
/* vsprintf with automatic memory allocation.
- Copyright (C) 1999, 2002-2007 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002-2008 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@@ -95,7 +95,7 @@
#if (NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && !defined IN_LIBINTL
# include <math.h>
-# include "isnan.h"
+# include "isnand.h"
#endif
#if (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE) && !defined IN_LIBINTL
@@ -106,7 +106,7 @@
#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL
# include <math.h>
-# include "isnan.h"
+# include "isnand.h"
# include "printf-frexp.h"
#endif
@@ -236,7 +236,7 @@ decimal_point_char ()
static int
is_infinite_or_zero (double x)
{
- return isnan (x) || x + x == x;
+ return isnand (x) || x + x == x;
}
#endif
@@ -2327,7 +2327,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
# if NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_DOUBLE
double arg = a.arg[dp->arg_index].a.a_double;
- if (isnan (arg))
+ if (isnand (arg))
{
if (dp->conversion == 'A')
{
@@ -2676,7 +2676,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
if (dp->conversion == 'f' || dp->conversion == 'F')
{
double arg = a.arg[dp->arg_index].a.a_double;
- if (!(isnan (arg) || arg + arg == arg))
+ if (!(isnand (arg) || arg + arg == arg))
{
/* arg is finite and nonzero. */
int exponent = floorlog10 (arg < 0 ? -arg : arg);
@@ -3080,7 +3080,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
{
double arg = a.arg[dp->arg_index].a.a_double;
- if (isnan (arg))
+ if (isnand (arg))
{
if (dp->conversion >= 'A' && dp->conversion <= 'Z')
{
@@ -4327,7 +4327,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
if (prec_ourselves)
{
/* Handle the precision. */
- TCHAR_T *prec_ptr =
+ TCHAR_T *prec_ptr =
# if USE_SNPRINTF
(TCHAR_T *) (result + length);
# else
@@ -4654,6 +4654,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
not have this limitation. */
return result;
+#if USE_SNPRINTF
overflow:
if (!(result == resultbuf || result == NULL))
free (result);
@@ -4662,6 +4663,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
CLEANUP ();
errno = EOVERFLOW;
return NULL;
+#endif
out_of_memory:
if (!(result == resultbuf || result == NULL))