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