120-portability.patch 981 B

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