clock.patch 682 B

1234567891011121314151617181920212223
  1. --- trunk/src/clock/clock.c (revision 652)
  2. +++ trunk/src/clock/clock.c (working copy)
  3. @@ -23,6 +23,8 @@
  4. #include <cairo-xlib.h>
  5. #include <pango/pangocairo.h>
  6. #include <stdlib.h>
  7. +#include <sys/types.h>
  8. +#include <sys/wait.h>
  9. #include "window.h"
  10. #include "server.h"
  11. @@ -98,6 +103,10 @@
  12. // remember old_sec because after suspend/hibernate the clock should be updated directly, and not
  13. // on next minute change
  14. time_t old_sec = time_clock.tv_sec;
  15. +
  16. + // Little hack to wait executed commands in clock_action avoiding zombies
  17. + waitpid(-1, NULL, WNOHANG);
  18. +
  19. gettimeofday(&time_clock, 0);
  20. if (time_clock.tv_sec % 60 == 0 || time_clock.tv_sec - old_sec > 60) {
  21. int i;