No subject


Thu Oct 6 05:08:24 CDT 2011


DESCRIPTION
       These  functions are provided in glibc as a compatibility interface =
for
       programs that make use of the historical System V signal API.  This =
API
       is  obsolete:  new applications should use the POSIX signal API (sig=
ac=E2=80=90
       tion(2), sigprocmask(2), etc.)

Signed-off-by: Kamal Dasu <kdasu.kdev at gmail.com>
---
 copy/xfs_copy.c |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c
index c01e0b9..800f4fd 100644
--- a/copy/xfs_copy.c
+++ b/copy/xfs_copy.c
@@ -71,6 +71,16 @@ xfs_off_t write_log_header(int fd, wbuf *w, xfs_mount_t =
*mp);
 #define PRE	0x08		/* append strerror string */
 #define LAST	0x10		/* final message we print */
=20
+static void
+signal_maskfunc(int sig, int how)=20
+{
+	sigset_t set;
+
+	sigemptyset(&set);
+	sigaddset(&set, sig);
+	sigprocmask(how, &set, NULL);
+}
+
 void
 do_message(int flags, int code, const char *fmt, ...)
 {
@@ -478,9 +488,9 @@ write_wbuf(void)
 		if (target[i].state !=3D INACTIVE)
 			pthread_mutex_unlock(&targ[i].wait);	/* wake up */
=20
-	sigrelse(SIGCHLD);
+	signal_maskfunc(SIGCHLD, SIG_UNBLOCK);
 	pthread_mutex_lock(&mainwait);
-	sighold(SIGCHLD);
+	signal_maskfunc(SIGCHLD, SIG_BLOCK);
 }
=20
=20
@@ -847,7 +857,7 @@ main(int argc, char **argv)
 	/* set up sigchild signal handler */
=20
 	signal(SIGCHLD, handler);
-	sighold(SIGCHLD);
+	signal_maskfunc(SIGCHLD, SIG_BLOCK);
=20
 	/* make children */
=20
--=20
1.7.5.4




More information about the xfs mailing list