From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 102578 invoked by alias); 24 Jul 2015 22:03:56 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 102564 invoked by uid 89); 24 Jul 2015 22:03:55 -0000 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 Received: from mout.kundenserver.de (HELO mout.kundenserver.de) (212.227.17.13) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 24 Jul 2015 22:03:54 +0000 Received: from [192.168.178.27] ([95.90.245.29]) by mrelayeu.kundenserver.de (mreue101) with ESMTPSA (Nemesis) id 0MbhXp-1ZbnUJ3pIr-00J2Fq for ; Sat, 25 Jul 2015 00:03:50 +0200 Message-ID: <55B2B644.8010506@towo.net> Date: Fri, 24 Jul 2015 22:03:00 -0000 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@cygwin.com Subject: Re: [ANNOUNCEMENT] Update: mintty 2.1.2 References: <63a08c60771faffa23bc1c029235301d.squirrel@oude-webmail.xs4all.nl> <55B22422.6000601@towo.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 X-SW-Source: 2015-07/txt/msg00386.txt.bz2 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