From 8f4f0136cf53e5696e964adad3e40394ec645b77 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Thu, 18 Jan 2007 16:15:42 +0000 Subject: [PATCH] * m4/gettimeofday.m4 (gl_GETTIMEOFDAY_REPLACE_LOCALTIME): Also replace gettimeofday. * lib/gettimeofday.c (rpl_gettimeofday): Declare with replacement name, to avoid infinite recursion. --- ChangeLog | 7 +++++++ lib/gettimeofday.c | 2 +- m4/gettimeofday.m4 | 4 +++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index d4169aa9d..6aabd47de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-01-18 Eric Blake + + * m4/gettimeofday.m4 (gl_GETTIMEOFDAY_REPLACE_LOCALTIME): Also + replace gettimeofday. + * lib/gettimeofday.c (rpl_gettimeofday): Declare with replacement + name, to avoid infinite recursion. + 2007-01-17 Paul Eggert * MODULES.html.sh (Support for systems lacking POSIX:2001): New diff --git a/lib/gettimeofday.c b/lib/gettimeofday.c index 1aee10760..b6d68657e 100644 --- a/lib/gettimeofday.c +++ b/lib/gettimeofday.c @@ -98,7 +98,7 @@ tzset (void) causes problems. */ int -gettimeofday (struct timeval *restrict tv, void *restrict tz) +rpl_gettimeofday (struct timeval *restrict tv, void *restrict tz) { #undef gettimeofday #if HAVE_GETTIMEOFDAY diff --git a/m4/gettimeofday.m4 b/m4/gettimeofday.m4 index 9f70e10ef..ec533594d 100644 --- a/m4/gettimeofday.m4 +++ b/m4/gettimeofday.m4 @@ -1,4 +1,4 @@ -#serial 9 +#serial 10 # Copyright (C) 2001, 2002, 2003, 2005, 2007 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation @@ -90,6 +90,8 @@ AC_DEFUN([gl_GETTIMEOFDAY_REPLACE_LOCALTIME], [ [Define to rpl_gmtime if the replacement function should be used.]) AC_DEFINE([localtime], [rpl_localtime], [Define to rpl_localtime if the replacement function should be used.]) + AC_DEFINE([gettimeofday], [rpl_gettimeofday], + [Define to rpl_gettimeofday if the replacement function should be used.]) ]) # Prerequisites of lib/gettimeofday.c. -- 2.11.0