Fix broken patch that prevents clang builds.
This commit is contained in:
parent
ca4bb06dcb
commit
cbed099f09
@ -1,33 +1,37 @@
|
||||
$OpenBSD: patch-bsd_c,v 1.1 2006/04/07 07:40:18 pvalchev Exp $
|
||||
--- bsd.c.orig Fri Apr 30 22:21:53 1993
|
||||
+++ bsd.c Fri Apr 7 01:38:55 2006
|
||||
@@ -69,8 +69,16 @@ ZOOFILE f;
|
||||
}
|
||||
|
||||
/* Function gettz() returns the offset from GMT in seconds */
|
||||
-long gettz()
|
||||
+long gettz(t)
|
||||
+#if defined(__OpenBSD__)
|
||||
+time_t t;
|
||||
+#else
|
||||
+long t;
|
||||
+#endif
|
||||
{
|
||||
+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
|
||||
+ return -localtime(&t)->tm_gmtoff;
|
||||
+#else
|
||||
$OpenBSD: patch-bsd_c,v 1.2 2017/04/12 23:17:57 jca Exp $
|
||||
--- bsd.c.orig Sat May 1 06:21:53 1993
|
||||
+++ bsd.c Thu Apr 13 01:16:06 2017
|
||||
@@ -74,26 +74,16 @@ long gettz()
|
||||
#define SEC_IN_DAY (24L * 60L * 60L)
|
||||
#define INV_VALUE (SEC_IN_DAY + 1L)
|
||||
static long retval = INV_VALUE; /* cache, init to impossible value */
|
||||
@@ -95,6 +103,7 @@ long gettz()
|
||||
-#ifndef __386BSD__
|
||||
- struct timeval tp;
|
||||
- struct timezone tzp;
|
||||
-#else
|
||||
time_t lt;
|
||||
struct tm *tm;
|
||||
-#endif
|
||||
+
|
||||
if (retval != INV_VALUE) /* if have cached value, return it */
|
||||
return retval;
|
||||
-#ifndef __386BSD__
|
||||
- gettimeofday (&tp, &tzp); /* specific to 4.3BSD */
|
||||
- /* return (tzp.tz_minuteswest * 60); */ /* old incorrect code */
|
||||
- /* Timezone fix thanks to Bill Davidsen <wedu@ge-crd.ARPA> */
|
||||
- /* !! - ache@hq.demos.su */
|
||||
- retval = tzp.tz_minuteswest * 60 - (tzp.tz_dsttime != 0) * 3600L;
|
||||
-#else
|
||||
+
|
||||
time(<);
|
||||
tm = localtime(<);
|
||||
retval = -tm->tm_gmtoff;
|
||||
#endif
|
||||
-#endif
|
||||
+
|
||||
return retval;
|
||||
+#endif
|
||||
}
|
||||
|
||||
/* Standard UNIX-compatible time routines */
|
||||
@@ -103,15 +112,19 @@ long gettz()
|
||||
@@ -103,15 +93,19 @@ long gettz()
|
||||
/* Standard UNIX-specific file attribute routines */
|
||||
#include "nixmode.i"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user