mirror of
https://github.com/Stichting-MINIX-Research-Foundation/pkgsrc-ng.git
synced 2025-08-03 17:59:07 -04:00
59 lines
1.4 KiB
Plaintext
59 lines
1.4 KiB
Plaintext
$NetBSD: patch-ac,v 1.3 1999/05/22 22:07:04 tv Exp $
|
|
|
|
--- environ.c.orig Mon Sep 29 06:00:24 1997
|
|
+++ environ.c Sat May 22 18:03:52 1999
|
|
@@ -430,16 +430,17 @@
|
|
|
|
#define SUBS_DEFINED
|
|
|
|
+#include <stdlib.h>
|
|
+#include <string.h>
|
|
#include <time.h>
|
|
+#include <sys/types.h>
|
|
|
|
-#ifndef time_t
|
|
-#define time_t long
|
|
-#endif
|
|
-
|
|
+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
|
|
extern struct tm *localtime();
|
|
extern time_t time();
|
|
extern char *strcpy();
|
|
extern voidp *malloc();
|
|
+#endif
|
|
|
|
FILE *
|
|
file_open(name, mode)
|
|
@@ -535,8 +536,12 @@
|
|
}
|
|
|
|
long
|
|
-gettz() /* returns the offset from GMT in seconds */
|
|
+gettz(stamp) /* returns the offset from GMT in seconds */
|
|
+time_t stamp;
|
|
{
|
|
+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
|
|
+ return -localtime(&stamp)->tm_gmtoff;
|
|
+#else
|
|
#define NOONOFFSET 43200L
|
|
#define SEC_IN_DAY (24L * 60L * 60L)
|
|
#define INV_VALUE (SEC_IN_DAY + 1L)
|
|
@@ -552,6 +557,7 @@
|
|
noontm = localtime(&noon);
|
|
retval = NOONOFFSET - 60 * (60 * noontm->tm_hour - noontm->tm_min);
|
|
return retval;
|
|
+#endif
|
|
}
|
|
|
|
long
|
|
@@ -609,7 +615,8 @@
|
|
(uint) attribute;
|
|
(uint) host;
|
|
|
|
- m_time = mstonix(tstamp) + gettz();
|
|
+ m_time = mstonix(tstamp);
|
|
+ m_time += gettz(m_time);
|
|
|
|
tb.mtime = m_time; /* Set modification time */
|
|
tb.atime = m_time; /* Set access time */
|