union-wait.patch 916 B

123456789101112131415161718192021222324252627
  1. diff -ru xautolock-2.2-orig/src/engine.c xautolock-2.2/src/engine.c
  2. --- xautolock-2.2-orig/src/engine.c 2007-12-28 18:15:26.000000000 +0100
  3. +++ xautolock-2.2/src/engine.c 2018-05-31 14:13:55.438216644 +0200
  4. @@ -210,22 +210,14 @@
  5. #else /* VMS */
  6. if (lockerPid)
  7. {
  8. -#if !defined (UTEKV) && !defined (SYSV) && !defined (SVR4)
  9. - union wait status; /* childs process status */
  10. -#else /* !UTEKV && !SYSV && !SVR4 */
  11. int status = 0; /* childs process status */
  12. -#endif /* !UTEKV && !SYSV && !SVR4 */
  13. if (unlockNow && !disabled)
  14. {
  15. (void) kill (lockerPid, SIGTERM);
  16. }
  17. -#if !defined (UTEKV) && !defined (SYSV) && !defined (SVR4)
  18. - if (wait3 (&status, WNOHANG, 0))
  19. -#else /* !UTEKV && !SYSV && !SVR4 */
  20. if (waitpid (-1, &status, WNOHANG))
  21. -#endif /* !UTEKV && !SYSV && !SVR4 */
  22. {
  23. /*
  24. * If the locker exited normally, we disable any pending kill