tmpwatch-2.11-boottime.patch 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. Make boot time detection failures non-fatal. Taken from PLD Linux
  2. Gentoo bug: https://bugs.gentoo.org/show_bug.cgi?id=468444
  3. PLD bug: https://bugs.launchpad.net/pld-linux/+bug/1034364
  4. Patch: https://github.com/pld-linux/tmpwatch/blob/master/tmpwatch-boottime.patch
  5. --- tmpwatch-2.11/tmpwatch.c~
  6. +++ tmpwatch-2.11/tmpwatch.c
  7. @@ -666,9 +666,11 @@
  8. time_t boot_time;
  9. if (clock_gettime(CLOCK_REALTIME, &real_clock) != 0
  10. - || clock_gettime(CLOCK_BOOTTIME, &boot_clock) != 0)
  11. - message(LOG_FATAL, "Error determining boot time: %s\n",
  12. + || clock_gettime(CLOCK_BOOTTIME, &boot_clock) != 0) {
  13. + message(LOG_DEBUG, "Error determining boot time: %s\n",
  14. strerror(errno));
  15. + socket_kill_time = 0; /* Never remove sockets */
  16. + } else {
  17. boot_time = real_clock.tv_sec - boot_clock.tv_sec;
  18. if (real_clock.tv_nsec < boot_clock.tv_nsec)
  19. boot_time--;
  20. @@ -677,6 +679,7 @@
  21. boot_time -= 2;
  22. socket_kill_time = boot_time - grace_seconds;
  23. + }
  24. #else
  25. socket_kill_time = 0; /* Never remove sockets */
  26. #endif