summaryrefslogtreecommitdiff
path: root/package/xfsprogs/patches/120-portability.patch
blob: d8bda81f0d7fbed8cadc83ea276ab37cb116b6fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
--- a/copy/xfs_copy.c
+++ b/copy/xfs_copy.c
@@ -463,6 +463,15 @@ read_ag_header(int fd, xfs_agnumber_t ag
 }
 
 
+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 */