X-Recipient: archive-cygwin@delorie.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:message-id:in-reply-to:references:date:subject
	:from:to:mime-version:content-type:content-transfer-encoding; q=
	dns; s=default; b=H2LETv9tKaLRjrxSyR/fv1ORtXjO1wYm6EDftruPUfoFEo
	cotfXG8LKqP3ZFA3oDBj4/0meJYzp8g/iGeYtC/gDvyp6B5wCqcACVtfiJFb07gU
	STZeDcHJAwr47zbvFTO3SuZDW2bnwgjNVnDRsuFm/SPozuvJkrQGT0FAswSFs=
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:message-id:in-reply-to:references:date:subject
	:from:to:mime-version:content-type:content-transfer-encoding; s=
	default; bh=yzkQgDmoHMzdepHKkbRe0H0uuNc=; b=O9u/dkyNCXdgOtx0VKqh
	NHVaUGuctDw85iOhzLlJoYUbnnkg7PQF5o/m/zDD4qtrLY/o13CKn+5EwA4GfrbJ
	AolFH9Z1YSpHooTKd1RxWJejlbPBQkN/9+jC/SBartxcMKWMzbzy1SfrVV77opyU
	qLyWynSv+Juk7YUQil6HCLM=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-0.6 required=5.0 tests=AWL,BAYES_05,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2
X-HELO: lb2-smtp-cloud2.xs4all.net
Message-ID: <be0351be5e3aa7b7ba980fc25f9cce0c.squirrel@oude-webmail.xs4all.nl>
In-Reply-To: <55B2B644.8010506@towo.net>
References: <announce.55B1677D.5080303@towo.net>    <63a08c60771faffa23bc1c029235301d.squirrel@oude-webmail.xs4all.nl>    <55B22422.6000601@towo.net>    <d9ef810e0ad325a9b51f641a10a06f0b.squirrel@oude-webmail.xs4all.nl>    <55B2B644.8010506@towo.net>
Date: Sat, 25 Jul 2015 19:03:43 +0200
Subject: Re: [ANNOUNCEMENT] Update: mintty 2.1.2
From: "Houder" <houder@xs4all.nl>
To: cygwin@cygwin.com, "Thomas Wolff" <towo@towo.net>
User-Agent: SquirrelMail/1.4.22
MIME-Version: 1.0
Content-Type: text/plain;charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-IsSubscribed: yes

>> Hi Thomas,
>>> Maybe setsid() should not be called if fork() fails...
>>> Could you try this please:
>>>     if (daemonize && !isatty(0)) {
>>>       int pid = fork();
>>>       if (pid > 0) exit(0);    // exit parent process
>>>       if (pid == 0) setsid();  // detach child process
>>>       if (pid < 0) {
>>>         error("could not detach from caller");
>>>         exit(9);
>>>       }
>>>     }
>> Hint: source code of setsid.c -- util-linux package)
> ... or maybe the parent thread should not exit immediately but wait:
>    if (daemonize && !isatty(0)) {
> #include <sys/wait.h>
>      int status;
>      int pid = fork();
>      if (pid > 0) {
>        waitpid(pid, &status, 0);
>        exit(0);
>      }
>      setsid();
>    }
>
> Can you please try both alternatives?

Hi Thomas,

I found the bug (more or less): it is me (AND you). More will follow soon.

Henri


--
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

