tftp.patch 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. Index: Makefile
  2. --- Makefile.orig 2004-01-08 21:48:51 +0100
  3. +++ Makefile 2004-09-03 20:19:54 +0200
  4. @@ -58,9 +58,9 @@
  5. # Adding "configure" to the dependencies serializes this with running
  6. # autoconf, because there are apparently race conditions between
  7. # autoconf and autoheader.
  8. -aconfig.h.in: configure.in configure aclocal.m4
  9. - rm -f aconfig.h.in aconfig.h
  10. - autoheader
  11. +#aconfig.h.in: configure.in configure aclocal.m4
  12. +# rm -f aconfig.h.in aconfig.h
  13. +# autoheader
  14. configure: configure.in aclocal.m4
  15. rm -rf MCONFIG configure config.log aconfig.h *.cache
  16. Index: tftpd/tftpd.c
  17. --- tftpd/tftpd.c.orig 2004-06-13 23:11:24 +0200
  18. +++ tftpd/tftpd.c 2004-09-03 20:19:54 +0200
  19. @@ -502,6 +502,22 @@
  20. #ifdef HAVE_SETSID
  21. setsid();
  22. #endif
  23. +#ifdef PID_FILE
  24. + /* Write PID file */
  25. + {
  26. + mode_t old_umask;
  27. + pid_t pid;
  28. + FILE *fp;
  29. +
  30. + old_umask = umask((mode_t) 0022);
  31. + pid = getpid();
  32. + if ((fp = fopen(PID_FILE, "w")) == NULL)
  33. + syslog(LOG_ERR, "cannot write PID file '%s'", PID_FILE);
  34. + fprintf(fp, "%ld\n", (long)pid);
  35. + fclose(fp);
  36. + umask(old_umask);
  37. + }
  38. +#endif
  39. }
  40. } else {
  41. /* 0 is our socket descriptor */