tftp/tftp.patch

Mon, 25 Aug 2014 19:06:31 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Mon, 25 Aug 2014 19:06:31 +0200
changeset 795
ef076e9bc56b
permissions
-rw-r--r--

Import package vendor original specs for necessary manipulations.

     1 Index: MCONFIG.in
     2 --- MCONFIG.in.orig	2011-06-23 01:32:56.000000000 +0200
     3 +++ MCONFIG.in	2011-06-24 20:54:05.000000000 +0200
     4 @@ -21,6 +21,7 @@
     5  # Prefixes
     6  prefix      = @prefix@
     7  exec_prefix = @exec_prefix@
     8 +datarootdir = @datarootdir@
    10  # Directory for user binaries
    11  BINDIR  = @bindir@
    12 Index: Makefile
    13 --- Makefile.orig	2011-06-23 01:32:56.000000000 +0200
    14 +++ Makefile	2011-06-24 20:54:05.000000000 +0200
    15 @@ -59,9 +59,9 @@
    16  # Adding "configure" to the dependencies serializes this with running
    17  # autoconf, because there are apparently race conditions between
    18  # autoconf and autoheader.
    19 -aconfig.h.in: configure.in configure aclocal.m4
    20 -	rm -f aconfig.h.in aconfig.h
    21 -	autoheader
    22 +#aconfig.h.in: configure.in configure aclocal.m4
    23 +#	rm -f aconfig.h.in aconfig.h
    24 +#	autoheader
    26  configure: configure.in aclocal.m4
    27  	rm -rf MCONFIG configure config.log aconfig.h *.cache
    28 Index: tftpd/tftpd.c
    29 --- tftpd/tftpd.c.orig	2011-06-23 01:32:56.000000000 +0200
    30 +++ tftpd/tftpd.c	2011-06-24 20:54:05.000000000 +0200
    31 @@ -33,6 +33,9 @@
    32   * SUCH DAMAGE.
    33   */
    35 +#if defined(__NetBSD__)
    36 +#define _NETBSD_SOURCE
    37 +#endif
    38  #include "config.h"             /* Must be included first */
    39  #include "tftpd.h"
    41 @@ -767,6 +770,22 @@
    42  #ifndef __CYGWIN__
    43          set_socket_nonblock(fd, 1);
    44  #endif
    45 +#ifdef PID_FILE
    46 +  /* Write PID file */
    47 +  {
    48 +    mode_t old_umask;
    49 +    pid_t  pid;
    50 +    FILE   *fp;
    51 +
    52 +    old_umask = umask((mode_t) 0022);
    53 +    pid = getpid();
    54 +    if ((fp = fopen(PID_FILE, "w")) == NULL)
    55 +      syslog(LOG_ERR, "cannot write PID file '%s'", PID_FILE);
    56 +    fprintf(fp, "%ld\n", (long)pid);
    57 +    fclose(fp);
    58 +    umask(old_umask);
    59 +  }
    60 +#endif
    61      }
    63      /* Disable path MTU discovery */

mercurial