1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/tftp/tftp.patch Mon Aug 25 19:06:31 2014 +0200 1.3 @@ -0,0 +1,63 @@ 1.4 +Index: MCONFIG.in 1.5 +--- MCONFIG.in.orig 2011-06-23 01:32:56.000000000 +0200 1.6 ++++ MCONFIG.in 2011-06-24 20:54:05.000000000 +0200 1.7 +@@ -21,6 +21,7 @@ 1.8 + # Prefixes 1.9 + prefix = @prefix@ 1.10 + exec_prefix = @exec_prefix@ 1.11 ++datarootdir = @datarootdir@ 1.12 + 1.13 + # Directory for user binaries 1.14 + BINDIR = @bindir@ 1.15 +Index: Makefile 1.16 +--- Makefile.orig 2011-06-23 01:32:56.000000000 +0200 1.17 ++++ Makefile 2011-06-24 20:54:05.000000000 +0200 1.18 +@@ -59,9 +59,9 @@ 1.19 + # Adding "configure" to the dependencies serializes this with running 1.20 + # autoconf, because there are apparently race conditions between 1.21 + # autoconf and autoheader. 1.22 +-aconfig.h.in: configure.in configure aclocal.m4 1.23 +- rm -f aconfig.h.in aconfig.h 1.24 +- autoheader 1.25 ++#aconfig.h.in: configure.in configure aclocal.m4 1.26 ++# rm -f aconfig.h.in aconfig.h 1.27 ++# autoheader 1.28 + 1.29 + configure: configure.in aclocal.m4 1.30 + rm -rf MCONFIG configure config.log aconfig.h *.cache 1.31 +Index: tftpd/tftpd.c 1.32 +--- tftpd/tftpd.c.orig 2011-06-23 01:32:56.000000000 +0200 1.33 ++++ tftpd/tftpd.c 2011-06-24 20:54:05.000000000 +0200 1.34 +@@ -33,6 +33,9 @@ 1.35 + * SUCH DAMAGE. 1.36 + */ 1.37 + 1.38 ++#if defined(__NetBSD__) 1.39 ++#define _NETBSD_SOURCE 1.40 ++#endif 1.41 + #include "config.h" /* Must be included first */ 1.42 + #include "tftpd.h" 1.43 + 1.44 +@@ -767,6 +770,22 @@ 1.45 + #ifndef __CYGWIN__ 1.46 + set_socket_nonblock(fd, 1); 1.47 + #endif 1.48 ++#ifdef PID_FILE 1.49 ++ /* Write PID file */ 1.50 ++ { 1.51 ++ mode_t old_umask; 1.52 ++ pid_t pid; 1.53 ++ FILE *fp; 1.54 ++ 1.55 ++ old_umask = umask((mode_t) 0022); 1.56 ++ pid = getpid(); 1.57 ++ if ((fp = fopen(PID_FILE, "w")) == NULL) 1.58 ++ syslog(LOG_ERR, "cannot write PID file '%s'", PID_FILE); 1.59 ++ fprintf(fp, "%ld\n", (long)pid); 1.60 ++ fclose(fp); 1.61 ++ umask(old_umask); 1.62 ++ } 1.63 ++#endif 1.64 + } 1.65 + 1.66 + /* Disable path MTU discovery */