michael@795: Index: MCONFIG.in michael@795: --- MCONFIG.in.orig 2011-06-23 01:32:56.000000000 +0200 michael@795: +++ MCONFIG.in 2011-06-24 20:54:05.000000000 +0200 michael@795: @@ -21,6 +21,7 @@ michael@795: # Prefixes michael@795: prefix = @prefix@ michael@795: exec_prefix = @exec_prefix@ michael@795: +datarootdir = @datarootdir@ michael@795: michael@795: # Directory for user binaries michael@795: BINDIR = @bindir@ michael@795: Index: Makefile michael@795: --- Makefile.orig 2011-06-23 01:32:56.000000000 +0200 michael@795: +++ Makefile 2011-06-24 20:54:05.000000000 +0200 michael@795: @@ -59,9 +59,9 @@ michael@795: # Adding "configure" to the dependencies serializes this with running michael@795: # autoconf, because there are apparently race conditions between michael@795: # autoconf and autoheader. michael@795: -aconfig.h.in: configure.in configure aclocal.m4 michael@795: - rm -f aconfig.h.in aconfig.h michael@795: - autoheader michael@795: +#aconfig.h.in: configure.in configure aclocal.m4 michael@795: +# rm -f aconfig.h.in aconfig.h michael@795: +# autoheader michael@795: michael@795: configure: configure.in aclocal.m4 michael@795: rm -rf MCONFIG configure config.log aconfig.h *.cache michael@795: Index: tftpd/tftpd.c michael@795: --- tftpd/tftpd.c.orig 2011-06-23 01:32:56.000000000 +0200 michael@795: +++ tftpd/tftpd.c 2011-06-24 20:54:05.000000000 +0200 michael@795: @@ -33,6 +33,9 @@ michael@795: * SUCH DAMAGE. michael@795: */ michael@795: michael@795: +#if defined(__NetBSD__) michael@795: +#define _NETBSD_SOURCE michael@795: +#endif michael@795: #include "config.h" /* Must be included first */ michael@795: #include "tftpd.h" michael@795: michael@795: @@ -767,6 +770,22 @@ michael@795: #ifndef __CYGWIN__ michael@795: set_socket_nonblock(fd, 1); michael@795: #endif michael@795: +#ifdef PID_FILE michael@795: + /* Write PID file */ michael@795: + { michael@795: + mode_t old_umask; michael@795: + pid_t pid; michael@795: + FILE *fp; michael@795: + michael@795: + old_umask = umask((mode_t) 0022); michael@795: + pid = getpid(); michael@795: + if ((fp = fopen(PID_FILE, "w")) == NULL) michael@795: + syslog(LOG_ERR, "cannot write PID file '%s'", PID_FILE); michael@795: + fprintf(fp, "%ld\n", (long)pid); michael@795: + fclose(fp); michael@795: + umask(old_umask); michael@795: + } michael@795: +#endif michael@795: } michael@795: michael@795: /* Disable path MTU discovery */