Index: Makefile --- Makefile.orig 2004-01-08 21:48:51 +0100 +++ Makefile 2004-09-03 20:19:54 +0200 @@ -58,9 +58,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: tftpd/tftpd.c --- tftpd/tftpd.c.orig 2004-06-13 23:11:24 +0200 +++ tftpd/tftpd.c 2004-09-03 20:19:54 +0200 @@ -502,6 +502,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 */