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:message-id:date:from:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; q=dns; s=default; b=n9hYqt/fKd9hkvcd+62L8SQauUCa1eKisnijycBzXfT Wp1mR+oosYP/wJtg+K3Lv15CgB/l6xDP6cwJ1LxpUd8DYIQhNdwmZfoe3qxtQGoK VYMATgfRhZGEKpeKSmMo2qsJB9yM6Y2oEw7R/oEHIoVCzsEzQyXoAIHx5OwdGk0s = 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:date:from:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; s=default; bh=j3uU/v5UJnYFkgv9HayG2k+REgk=; b=p/HqPfyVyMRiVlYfw lKppE/2JFjd5qM3x1tjk6fR/oGRh6Cz/rybU+xE1nvRetKVw2YV4Oq9qtTpWOdOA hS+Sas2H75uAZ6eYWjENzPFIFxZ3K6hdGxGEED5G7BsvKhlcu7gbM+jG/P7cCOjT 11rm9po2jSkeUnERY102uSWvb8= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , 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=3.7 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: mout.kundenserver.de Message-ID: <55B2B644.8010506@towo.net> Date: Sat, 25 Jul 2015 00:03:48 +0200 From: Thomas Wolff User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: [ANNOUNCEMENT] Update: mintty 2.1.2 References: <63a08c60771faffa23bc1c029235301d DOT squirrel AT oude-webmail DOT xs4all DOT nl> <55B22422 DOT 6000601 AT towo DOT net> In-Reply-To: X-TagToolbar-Keys: D20150725000348701 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-UI-Out-Filterresults: notjunk:1;V01:K0:CxFLg1a8TL8=:9JfhsEd6czdJQ/rMtCxPwc fr7o3+lBqFjieqVTb4U7lc6R2GrPK1zD2ZzPGJ92m6pJs0jdmw5J4ZNVs/prfJ2HkxgFE0Ij2 EPBW6g2hG2sA9s1nvGxpRAf/lbzrApo0w+Nvq+Kq1CrknJwwrGnHaI75A3FBK7Od6ITDnb/RQ WXlO2dK1XJqWFsDHMZFSBjKOwIN8+ULQhzkd2IWJThpb3OT13a3gXq7fy8GF+38UYPeIpMj/H +2uFZiOWIHd+EdA1DfHClXThn/LyZrQpQuyb/TEAIDruIucdwD99ht/b96AMl2mrpOuiALyrN xDLAdEIrnpsX8mvEUxg25Lehl13X3l+QPSZlEXX4/QmW9pPvMEQ9C/0whC8ubC2il8Zl4xi+u KxlaaqeebMFcD3kWUr/iGw443m/HrM9dn4DWxlMciW+wYpSMI6HSaHbRanTBD7WJ/s8TUFtBx gb3XhGJKlhjt2nz84DGFzthvlmWYqqVxKBNfyPzNhzaYgbKPLQ4OCWsV3qxc08juDhZn6bq4W yO/itBtHjRZuQb9Gu9gGPmz5Adqn0PJqcpyGw5UZN2JUjf2UCoofv2YTVtzcFA3fe5HItg/I3 Hf4DYh7eHggxxkEQIjFr6ooBU+LukXVYNTZy/30tdalRqi2EvQfzAn3o5fqYSxK7VqLBuRk7v F2VjswDQOxaLyXgDnigzj7jnK+W78+MQwom/hjXIhPSnmiw== X-IsSubscribed: yes Am 24.07.2015 um 15:18 schrieb Houder: > 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 int status; int pid = fork(); if (pid > 0) { waitpid(pid, &status, 0); exit(0); } setsid(); } Can you please try both alternatives? Thomas -- 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