Index: Makefile --- Makefile.orig 2006-10-05 23:23:01 +0200 +++ Makefile 2006-10-06 07:41:41 +0200 @@ -59,9 +59,9 @@ # Adding "configure" to the dependencies serializes this with running # autoconf, because there are apparently race conditions between # autoconf and autoheader. -aconfig.h.in: configure.in configure aclocal.m4 - rm -f aconfig.h.in aconfig.h - autoheader +#aconfig.h.in: configure.in configure aclocal.m4 +# rm -f aconfig.h.in aconfig.h +# autoheader configure: configure.in aclocal.m4 rm -rf MCONFIG configure config.log aconfig.h *.cache Index: configure --- configure.orig 2006-10-05 23:23:14 +0200 +++ configure 2006-10-06 07:49:18 +0200 @@ -9877,6 +9877,9 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +#if HAVE_SYS_SOCKET_H +# include +#endif int main () { Index: tftpd/tftpd.c --- tftpd/tftpd.c.orig 2004-09-15 00:38:46 +0200 +++ tftpd/tftpd.c 2005-06-11 13:43:54 +0200 @@ -35,6 +35,9 @@ * SUCH DAMAGE. */ +#if defined(__NetBSD__) +#define _NETBSD_SOURCE +#endif #include "config.h" /* Must be included first */ #include "tftpd.h" @@ -502,6 +505,22 @@ #ifdef HAVE_SETSID setsid(); #endif +#ifdef PID_FILE + /* Write PID file */ + { + mode_t old_umask; + pid_t pid; + FILE *fp; + + old_umask = umask((mode_t) 0022); + pid = getpid(); + if ((fp = fopen(PID_FILE, "w")) == NULL) + syslog(LOG_ERR, "cannot write PID file '%s'", PID_FILE); + fprintf(fp, "%ld\n", (long)pid); + fclose(fp); + umask(old_umask); + } +#endif } } else { /* 0 is our socket descriptor */