1d5905a67d0c27312bc08b2a458805b1efb19b96
[openwrt/openwrt.git] / package / utils / xfsprogs / patches / 120-portability.patch
1 commit d2aef8b3967e53fe58178f5af50fef488ee0faed
2 Author: Jens Muecke <jens@nons.de>
3 Date: Thu Jan 26 00:37:52 2012 +0100
4
5 120-portability
6
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 ag
10 }
11
12
13 +static void sig_mask(int type)
14 +{
15 + sigset_t mask;
16 + sigemptyset(&mask);
17 + sigaddset(&mask, SIGCHLD);
18 + sigprocmask(type, &mask, NULL);
19 +}
20 +
21 +
22 void
23 write_wbuf(void)
24 {
25 @@ -478,9 +487,9 @@ write_wbuf(void)
26 if (target[i].state != INACTIVE)
27 pthread_mutex_unlock(&targ[i].wait); /* wake up */
28
29 - sigrelse(SIGCHLD);
30 + sig_mask(SIG_UNBLOCK);
31 pthread_mutex_lock(&mainwait);
32 - sighold(SIGCHLD);
33 + sig_mask(SIG_BLOCK);
34 }
35
36
37 @@ -847,7 +856,7 @@ main(int argc, char **argv)
38 /* set up sigchild signal handler */
39
40 signal(SIGCHLD, handler);
41 - sighold(SIGCHLD);
42 + sig_mask(SIG_BLOCK);
43
44 /* make children */
45