From: Joshua Kinard <kumba@gentoo.org>
To: xfs@oss.sgi.com
Subject: [PATCH 2/3] xfsprogs: misc uClibc patches: use POSIX signal API
Date: Mon, 18 Jan 2016 05:29:25 -0500 [thread overview]
Message-ID: <569CBE85.4030800@gentoo.org> (raw)
From: Joshua Kinard <kumba@gentoo.org>
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
Signed-off-by: Joshua Kinard <kumba@gentoo.org>
Suggested-by: René Rhéaume <rene.rheaume@gmail.com>
---
copy/xfs_copy.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff -Naurp xfsprogs-4.3.0.orig/copy/xfs_copy.c xfsprogs-4.3.0/copy/xfs_copy.c
--- xfsprogs-4.3.0.orig/copy/xfs_copy.c 2015-10-15 21:31:26.000000000 +0000
+++ xfsprogs-4.3.0/copy/xfs_copy.c 2016-01-01 10:53:04.722229000 +0000
@@ -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
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
reply other threads:[~2016-01-18 10:29 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=569CBE85.4030800@gentoo.org \
--to=kumba@gentoo.org \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox