Skip to content

Commit 84b0115

Browse files
carenasgitster
authored andcommitted
compat: remove gmtime
ccd4694 (date.c: switch to reentrant {gm,local}time_r, 2019-11-28) removes the only gmtime() call we had and moves to gmtime_r() which doesn't have the same portability problems. Remove the compat gmtime code since it is no longer needed, and confirm by successfull running t4212 in FreeBSD 9.3 amd64 (the oldest I could get a hold off). Further work might be needed to ensure 32bit time_t systems (like FreeBSD i386) will handle correctly the overflows tested in t4212, but that is orthogonal to this change, and it doesn't change the current behaviour as neither gmtime() or gmtime_r() will ever return NULL on those systems because time_t is unsigned. Signed-off-by: Carlo Marcelo Arenas Belón <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7397ca3 commit 84b0115

File tree

4 files changed

+0
-45
lines changed

4 files changed

+0
-45
lines changed

Makefile

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -405,9 +405,6 @@ all::
405405
# with a different indexfile format version. If it isn't set the index
406406
# file format used is index-v[23].
407407
#
408-
# Define GMTIME_UNRELIABLE_ERRORS if your gmtime() function does not
409-
# return NULL when it receives a bogus time_t.
410-
#
411408
# Define HAVE_CLOCK_GETTIME if your platform has clock_gettime.
412409
#
413410
# Define HAVE_CLOCK_MONOTONIC if your platform has CLOCK_MONOTONIC.
@@ -1801,11 +1798,6 @@ ifndef NO_MSGFMT_EXTENDED_OPTIONS
18011798
MSGFMT += --check --statistics
18021799
endif
18031800

1804-
ifdef GMTIME_UNRELIABLE_ERRORS
1805-
COMPAT_OBJS += compat/gmtime.o
1806-
BASIC_CFLAGS += -DGMTIME_UNRELIABLE_ERRORS
1807-
endif
1808-
18091801
ifdef HAVE_CLOCK_GETTIME
18101802
BASIC_CFLAGS += -DHAVE_CLOCK_GETTIME
18111803
endif

compat/gmtime.c

Lines changed: 0 additions & 29 deletions
This file was deleted.

config.mak.uname

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ ifeq ($(uname_S),FreeBSD)
237237
PYTHON_PATH = /usr/local/bin/python
238238
PERL_PATH = /usr/local/bin/perl
239239
HAVE_PATHS_H = YesPlease
240-
GMTIME_UNRELIABLE_ERRORS = UnfortunatelyYes
241240
HAVE_BSD_SYSCTL = YesPlease
242241
HAVE_BSD_KERN_PROC_SYSCTL = YesPlease
243242
PAGER_ENV = LESS=FRX LV=-c MORE=FRX

git-compat-util.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,13 +1208,6 @@ int access_or_die(const char *path, int mode, unsigned flag);
12081208
/* Warn on an inaccessible file if errno indicates this is an error */
12091209
int warn_on_fopen_errors(const char *path);
12101210

1211-
#ifdef GMTIME_UNRELIABLE_ERRORS
1212-
struct tm *git_gmtime(const time_t *);
1213-
struct tm *git_gmtime_r(const time_t *, struct tm *);
1214-
#define gmtime git_gmtime
1215-
#define gmtime_r git_gmtime_r
1216-
#endif
1217-
12181211
#if !defined(USE_PARENS_AROUND_GETTEXT_N) && defined(__GNUC__)
12191212
#define USE_PARENS_AROUND_GETTEXT_N 1
12201213
#endif

0 commit comments

Comments
 (0)