openbsd-ports/archivers/unarj/patches/patch-environ_c
obecian e73603ade9 + rename patches
+ integrate COMMENT
+ bump version

ports/archivers - ports@ maintained ports
2001-03-29 11:41:17 +00:00

69 lines
1.5 KiB
Plaintext

--- environ.c.orig Mon Sep 29 06:00:24 1997
+++ environ.c Wed Mar 3 22:39:43 1999
@@ -40,11 +40,14 @@
#define SUBS_DEFINED
+#include <stdlib.h>
#include <string.h>
#include <dos.h>
#include <io.h>
#include <fcntl.h>
#include <alloc.h>
+#include <sys/types.h>
+#include <utime.h>
FILE *
file_open(name, mode)
@@ -432,14 +435,17 @@
#include <time.h>
+#if !(defined(__OpenBSD__))
#ifndef time_t
#define time_t long
#endif
+#endif
+#if !(defined(BSD) && BSD >= 199306)
extern struct tm *localtime();
-extern time_t time();
extern char *strcpy();
extern voidp *malloc();
+#endif
FILE *
file_open(name, mode)
@@ -535,8 +541,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 +562,7 @@
noontm = localtime(&noon);
retval = NOONOFFSET - 60 * (60 * noontm->tm_hour - noontm->tm_min);
return retval;
+#endif
}
long
@@ -609,7 +620,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 */