Skip to contentSkip to conversation

xfsprogs: misc uClibc patches: use POSIX signal API

PATCH In review Joshua Kinard 1 participant 1 message Jan 18, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 2/3 xfsprogs: misc uClibc patches: use POSIX signal API

From: Joshua Kinard <[email protected]>

uClibc doesn't provide the sigrelse or sighold calls, so this patch replaces them with POSIX signal API calls (sigprocmask(2), etc).

Refer to Gentoo Bug #477758:
https://bugs.gentoo.org/show_bug.cgi?id=477758

---
 copy/xfs_copy.c |   16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
copy/xfs_copy.c +13 -3
diff -Naurp xfsprogs-4.3.0.orig/copy/xfs_copy.c xfsprogs-4.3.0/copy/xfs_copy.c
@@ -75,6 +75,16 @@ static int	format_logs(struct xfs_mount
 #define LAST	0x10		/* final message we print */
 
 void
+signal_maskfunc(int addset, int newset)
+{
+	sigset_t set;
+
+	sigemptyset(&set);
+	sigaddset(&set, addset);
+	sigprocmask(newset, &set, NULL);
+}
+
+void
 do_message(int flags, int code, const char *fmt, ...)
 {
 	va_list	ap;
@@ -477,9 +487,9 @@ write_wbuf(void)
 		if (target[i].state != INACTIVE)
 			pthread_mutex_unlock(&targ[i].wait);	/* wake up */
 
-	sigrelse(SIGCHLD);
+	signal_maskfunc(SIGCHLD, SIG_UNBLOCK);
 	pthread_mutex_lock(&mainwait);
-	sighold(SIGCHLD);
+	signal_maskfunc(SIGCHLD, SIG_BLOCK);
 }
 
 void
@@ -893,7 +903,7 @@ main(int argc, char **argv)
 	/* set up sigchild signal handler */
 
 	signal(SIGCHLD, handler);
-	sighold(SIGCHLD);
+	signal_maskfunc(SIGCHLD, SIG_BLOCK);
 
 	/* make children */
 

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs