On Nov 12 17:23, Eliot Moss wrote: > I went ahead and wrote a little program that narrows > down the rsync problem to a dup2 call. The program: > creates two pipes (for talking to a child process), > forks the child, and the child tries to dup2 the > pipe fds to its stdin and stdout. If it wins (which > it doesn't), it will then run sleep for 5 seconds > and quit. The parent closes some fds it doesn't need > and waits for the child, then quits. I attach the > program in question, and strace output. > > Cheers -- Eliot Moss
Thanks for the testcase. However, the problem is that I can't reproduce any problem using your testcase. I ran it on Windows XP SP3, Server 2008 SP1, and Windows 7. The result is this, just with changing PIDs: $ ./a_test pid = 3272, fin = 5, fout = 4 wait got 0 I assume you see some error, but you didn't explicitely write what error you see. The strace output shows an error when closing a socket, which is that dreaded Winsock error 10038, "socket operation on non-socket". The reason why this operation fails must be something on your machine. I'm just not sure how we can find out what that is, and how to avoid the error then. Simply ignoring error 10038 in close() doesn't sound like a terribly good idea... Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- 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