www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/08/20/08:59:57

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:message-id:from:to:subject:references
:in-reply-to:content-type; q=dns; s=default; b=tWEo+52cdkUbGIYiM
D+BdLOyV0CLioYK/hdcUG94AEPPPM1/V67QaPfqcQBj0YbPJ6BEBwhDyxxQbWGsZ
xid2xS8eTkZYqXZN3qrdrYadbzYEd2+pp5TINzOasugER44G1/LKrqIDv3l7DMY3
E8aE0SSKMp3YDp+ll3Fyf12Huk=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:message-id:from:to:subject:references
:in-reply-to:content-type; s=default; bh=SjO/N3qtOdBbv/KJ2ql5844
eBg4=; b=QZZ4ynS3avFMLfz0LGbtyY9bEKa3hHJKU4xr2Ra9sxkUEcadSg/p5Y3
0ZC39o89CnM0m+GNgwv4f5ADnLCMwN3HDZMpLDrG12y0mZWJvBb+mVogTeJuimVW
KSvVTVCCWRQGYTfJV6n9QvZca/EcLn1TrUjuGY30f9STvxtz3sqg=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-7.0 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=H*F:D*nl
X-HELO: lb1-smtp-cloud7.xs4all.net
Date: Sun, 20 Aug 2017 14:59:37 +0200
Message-ID: <46d2983f263cb1be122ad1c8f239c88c@smtp-cloud7.xs4all.net>
From: Houder <houder AT xs4all DOT nl>
To: cygwin AT cygwin DOT com
Subject: Re: REVISITED: Signal delivered while blocked
References: <c05c742f0f3809e6d1afb8fb2c646ad7 AT xs4all DOT nl>
In-Reply-to: <c05c742f0f3809e6d1afb8fb2c646ad7@xs4all.nl>
User-Agent: mua.awk 0.99
X-CMAE-Envelope: MS4wfFeZqDuqGNAZOqtxUaxCq20l8LJV0KbAOlAbXPYl+7vVfexgjJq7Tlbt0/zKjHPQoNudZZkoqYswyThMhUnfetSOpABVvi7pu9po7KVMMwi5skGEvgQn UIfFFm73Se++Y39JT89hUrrOcI+A0+IDOTLWS/b4p7xJZ6YcwPtyyxrj/PPkEtIDXvtBuEIc9bumDw==
X-IsSubscribed: yes

On Wed, 16 Aug 2017 23:22:31, Houder wrote:
> 
> Hi,
> 
> Please read this post first:
> 
>      https://cygwin.com/ml/cygwin/2017-08/msg00048.html
>      ( Signal delivered while blocked -- by Noah Misch, August 4th 2017 )
> 
> This post is not intended to "hijack" the post by Noah Misch; this post 
> only ships an alternative (i.e. revised) testcase for the one by provided
> by Noah Misch.
> 
> The alternative testcase in fact consists of 2 testcases (2 files):
> 
>   1. sigprocmask-exclusion4.c
>   2. sigprocmask-exclusion5.c

Only for those interested ...

I made a minor modification to the 2nd testcase (sigprocmask-exclusion5.c) (in
order to get it theoretically correct).

I modified the last part (bottom) of each handler. See below.

On request, I will upload the files again.

Regards,

Henri

-----
handler(): // old

#if defined(option1)
	if (sigprocmask(SIG_SETMASK, &oset, NULL) != 0) // herstel
		perror("sigprocmask");
#else
	r = sigdelset(&set, SIGCHLD);
	if (r != 0) puts("retvalH1b");
	if (sigprocmask(SIG_UNBLOCK, &set, NULL) != 0) // verwijder
		perror("sigprocmask");
				  // Cygwin: aborts, almost immediately
#endif
}

handler(): // new

#if defined(option1)
	if (sigprocmask(SIG_SETMASK, &oset, NULL) != 0) // herstel
		perror("sigprocmask");
#else
	{
		int rv = 0;
		if ( (rv = sigismember(&oset, SIGCHLD)) == -1)
			perror("sigismember");
		// if the other signal was enabled at the beginning, enable it again
		if (rv == 0) {
			if (sigprocmask(SIG_UNBLOCK, &set, NULL) != 0) // verwijder
				perror("sigprocmask");
		}
	}
#endif
}

-----
handler2(): // old

#if defined(option1)
	if (sigprocmask(SIG_SETMASK, &oset, NULL) != 0) // herstel
		perror("sigprocmask");
#else
	r = sigdelset(&set, SIGUSR1);
	if (r != 0) puts("retvalH2b");
	if (sigprocmask(SIG_UNBLOCK, &set, NULL) != 0) // verwijder
		perror("sigprocmask");
#endif
}

handler2(): // new

#if defined(option1)
	if (sigprocmask(SIG_SETMASK, &oset, NULL) != 0) // herstel
		perror("sigprocmask");
#else
	{
		int rv = 0;
		if ( (rv = sigismember(&oset, SIGUSR1)) == -1)
			perror("sigismember");
		// if the other signal was enabled at the beginning, enable it again
		if (rv == 0) {
			if (sigprocmask(SIG_UNBLOCK, &set, NULL) != 0) // verwijder
				perror("sigprocmask");
		}
	}
#endif
}

=====


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019