2
0

120-portability.patch 873 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. commit d2aef8b3967e53fe58178f5af50fef488ee0faed
  2. Author: Jens Muecke <jens@nons.de>
  3. Date: Thu Jan 26 00:37:52 2012 +0100
  4. 120-portability
  5. --- a/copy/xfs_copy.c
  6. +++ b/copy/xfs_copy.c
  7. @@ -463,6 +463,15 @@ read_ag_header(int fd, xfs_agnumber_t ag
  8. }
  9. +static void sig_mask(int type)
  10. +{
  11. + sigset_t mask;
  12. + sigemptyset(&mask);
  13. + sigaddset(&mask, SIGCHLD);
  14. + sigprocmask(type, &mask, NULL);
  15. +}
  16. +
  17. +
  18. void
  19. write_wbuf(void)
  20. {
  21. @@ -478,9 +487,9 @@ write_wbuf(void)
  22. if (target[i].state != INACTIVE)
  23. pthread_mutex_unlock(&targ[i].wait); /* wake up */
  24. - sigrelse(SIGCHLD);
  25. + sig_mask(SIG_UNBLOCK);
  26. pthread_mutex_lock(&mainwait);
  27. - sighold(SIGCHLD);
  28. + sig_mask(SIG_BLOCK);
  29. }
  30. @@ -847,7 +856,7 @@ main(int argc, char **argv)
  31. /* set up sigchild signal handler */
  32. signal(SIGCHLD, handler);
  33. - sighold(SIGCHLD);
  34. + sig_mask(SIG_BLOCK);
  35. /* make children */