delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/01/30/20:44:10

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Wed, 30 Jan 2002 20:43:57 -0500
From: Christopher Faylor <cgf AT redhat DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: cygwin port of rsync -- patch for Win2k (rsync 2.5.1)
Message-ID: <20020131014357.GC22296@redhat.com>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <3C581EC5 DOT 20100 AT rochester DOT rr DOT com> <3C587F40 DOT FB1EED18 AT lapo DOT it>
Mime-Version: 1.0
In-Reply-To: <3C587F40.FB1EED18@lapo.it>
User-Agent: Mutt/1.3.23.1i

On Thu, Jan 31, 2002 at 12:18:24AM +0100, Lapo Luchini wrote:
>I don't think I have enough knowledge on the "fork() in cygwin" subject to
>evaluate if there are better solutions, I reply also in the mailing list.
>
>Lapo
>
>BTW: I'll try the fix soon, just wanted some more "advice from the gurus"
>about the issue ;)
>
>Chuck Messenger wrote:
>
>> Hi Lapo,
>>
>> I've been trying out the Cygwin port of rsync -- version 2.5.1.  I've
>> found that it doesn't work in server (i.e. --daemon) mode on my Win2k
>> box, but it does work on my Win98 box.
>>
>> I did some debugging, and came up with a fix.
>>
>> In socket.c, we have the following code which the server executes after
>> being connected to by a client:
>>
>>          if (fork()==0) {
>>              close(s);
>>              /* open log file in child before possibly giving
>>                 up privileges  */
>>              log_open();
>>              _exit(fn(fd));
>>          }
>>
>>   >>> delay(1);    /* CHM addition */
>>
>>          close(fd);
>>
>> I've marked my addition with >>>.  What seems to happen on Win2k is that
>> the close(fd) gets called by the mother process before the child process
>> gets going.

Sorry, but this is as impossible on cygwin as it is on UNIX.

I am not saying that there can't be a problem but the analysis that the
parent process is closing something in the child really can't be
correct.

As always, I'd appreciate debugging of this situation.  It's a given
that one doesn't implicitly have knowledge.  You have to gain knowledge
by looking at the code and running the debugger.  The techniques in
the file how-to-debug-cygwin.txt should provide you with ways to get
started.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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