mirror of
https://github.com/Stichting-MINIX-Research-Foundation/pkgsrc-ng.git
synced 2025-09-22 11:04:51 -04:00
32 lines
654 B
Plaintext
32 lines
654 B
Plaintext
$NetBSD: patch-al,v 1.2 2011/11/15 00:11:07 dholland Exp $
|
|
|
|
- 64-bit time_t fixes
|
|
- use standard includes
|
|
|
|
--- lib/os.c.orig 1996-07-18 23:31:32.000000000 +0000
|
|
+++ lib/os.c
|
|
@@ -28,6 +28,7 @@ static char *rcsid = "$Id: os.c,v 1.63 1
|
|
#include "../config.h"
|
|
|
|
#include <stdio.h>
|
|
+#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <sys/types.h>
|
|
#include <sys/param.h>
|
|
@@ -1137,3 +1138,15 @@ same_hostip (host1, host2)
|
|
return (addr1 == addr2);
|
|
}
|
|
|
|
+/* a ctime() replacement that reads a 32bit timestamp, even when
|
|
+ time_t has a different size. */
|
|
+
|
|
+char *
|
|
+ctime32(tp)
|
|
+ int32_t *tp;
|
|
+{
|
|
+ time_t thetime = *tp;
|
|
+
|
|
+ return ctime(&thetime);
|
|
+}
|
|
+
|