This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: [ANNOUNCEMENT] Update: mintty 2.1.2
- From: "Houder" <houder at xs4all dot nl>
- To: cygwin at cygwin dot com, "Thomas Wolff" <towo at towo dot net>
- Date: Sat, 25 Jul 2015 19:03:43 +0200
- Subject: Re: [ANNOUNCEMENT] Update: mintty 2.1.2
- Authentication-results: sourceware.org; auth=none
- References: <announce dot 55B1677D dot 5080303 at towo dot net> <63a08c60771faffa23bc1c029235301d dot squirrel at oude-webmail dot xs4all dot nl> <55B22422 dot 6000601 at towo dot net> <d9ef810e0ad325a9b51f641a10a06f0b dot squirrel at oude-webmail dot xs4all dot nl> <55B2B644 dot 8010506 at towo dot net>
>> 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