Most gmtime implementations return a NULL value when they
encounter an error (and this behavior is specified by ANSI C
and POSIX). FreeBSD's implementation, however, will
indicate an error by returning a pointer to a struct tm
with all fields set to zero. Let's also recognize this and
convert it
Am 01.04.2014 09:42, schrieb Jeff King:
diff --git a/compat/gmtime.c b/compat/gmtime.c
new file mode 100644
index 000..ffcabf4
--- /dev/null
+++ b/compat/gmtime.c
@@ -0,0 +1,26 @@
+#include ../git-compat-util.h
+#undef gmtime
+#undef gmtime_r
+
+struct tm *git_gmtime(const time_t *timep)
+{
René Scharfe l@web.de writes:
Am 01.04.2014 09:42, schrieb Jeff King:
diff --git a/compat/gmtime.c b/compat/gmtime.c
new file mode 100644
index 000..ffcabf4
--- /dev/null
+++ b/compat/gmtime.c
@@ -0,0 +1,26 @@
+#include ../git-compat-util.h
+#undef gmtime
+#undef gmtime_r
+
Am 01.04.2014 21:08, schrieb Junio C Hamano:
René Scharfe l@web.de writes:
Am 01.04.2014 09:42, schrieb Jeff King:
diff --git a/compat/gmtime.c b/compat/gmtime.c
new file mode 100644
index 000..ffcabf4
--- /dev/null
+++ b/compat/gmtime.c
@@ -0,0 +1,26 @@
+#include ../git-compat-util.h
On Tue, Apr 01, 2014 at 11:17:14PM +0200, René Scharfe wrote:
So are you saying we should set EOVERFLOW ourselves, or does FreeBSD
set EOVERFLOW for us in this case and we do not have to worry?
If we correct the return value then we should correct errno as well.
gmtime() on FreeBSD 10
5 matches
Mail list logo