pkgsrc/net/icsi-finger/patches/patch-al
is 4f4f18901b Fix for 64bit time_t:
- make the packet contain explicit 32bit data for compatibility with
  clients on machines with 32bit time_t.
- replace ctime() calls on such changed former time_t values by a
  shim that does the translation.
This does not start to work after 2038 yet - that would need a change
of the collection protocol.
2011-01-18 12:28:25 +00:00

20 lines
406 B
Text

$NetBSD: patch-al,v 1.1 2011/01/18 12:28:25 is Exp $
--- lib/os.c.orig 1996-07-18 23:31:32.000000000 +0000
+++ lib/os.c
@@ -1137,3 +1137,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);
+}
+