$NetBSD: patch-ab,v 1.8 2010/01/15 23:47:14 dholland Exp $ - Include fixes for modern Unix. - Don't try to use /usr/tmp. - Time handling fixes for NetBSD with 64-bit time_t. Upstream: as far as I know not actively maintained upstream. --- unixos.c.orig 2003-07-21 16:54:05.000000000 -0400 +++ unixos.c 2009-02-15 14:56:48.000000000 -0500 @@ -23,9 +23,11 @@ * SOFTWARE. */ #include +#include #include #include #include +#include #include #include #include @@ -38,10 +40,6 @@ #define MAXHOSTNAMELEN 64 #endif -extern int errno; -extern char *malloc(); -extern char *getenv(); - int overwrite_files = 0; int didchat; @@ -76,7 +74,7 @@ char *os_genid(void) } result = malloc(25+strlen(hostname)); - sprintf(result, "%d.%d@%s", pid, curtime++, hostname); + sprintf(result, "%d.%lld@%s", pid, (long long) curtime++, hostname); return result; } @@ -90,7 +88,11 @@ char *os_idtodir(char *id) strcpy(buf, getenv("TMPDIR")); } else { - strcpy(buf, "/usr/tmp"); +#if defined(P_tmpdir) + strcpy(buf, P_tmpdir); +#else + strcpy(buf, "/var/tmp"); +#endif } strcat(buf, "/m-prts-"); p = getenv("USER");