Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <3B3234AD.39E76913@mediavisual.com> Date: Fri, 22 Jun 2001 01:53:49 +0800 From: Paul Gresham X-Mailer: Mozilla 4.73 [en]C-{C-UDP; EBM-SONY1} (Win95; U) X-Accept-Language: en MIME-Version: 1.0 To: cygwin-xfree AT cygwin DOT com, mhoskin AT ucdavis DOT edu, cygwin AT cygwin DOT com Subject: Re: kernel patch for "Can't open display" - also fixes CVS problem The descriptor is a file, not a socket Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mark, thanks very much, it works fine, I think that patch needs to get into the main cygwin tree asap, as you have also fixed all my problems with cvs under cygwin on WinME. Thanks again. There are a lot of posts for the past few versions of Cygwin regarding the CVS problem, hence the cross-post and full quote of your message. Cheers Paul """ To all that receive the "Can't open display" message for your X clients. If this is not related to the DISPLAY variable, and other obvious problems, then this kernel patch may help you. I just hacked this together last night, so YMMV, but for the brave you can download a new cygwin1.dll from my site at: http://zambezi.cs.ucdavis.edu/~mark/cygwin1.dll Copy this cygwin1.dll into /bin for the latest release of cygwin. It works for me, but no assurances about your results. Here is a description of the problem. This description pertains to the winsup/cygwin portion of the cygwin kernel. Inside of the client code for X applications, you will find a fcntl F_SETFD. By default the fhandle_socket.cc file for the kernel passes this to fhandle.cc. Inside of fhandle.cc the F_SETFD gets passed to "set_close_on_exec(...)". This then calls set_inheritence(..), which has this ominous line in it: . . /* FIXME: This won't work with sockets */ { ForceCloseHandle2(h, name); . . Anyway, needless to say, the problem has to do with the duplicate handle not being valid for subsequent socket calls. A "fix" that I implemented is to disable the close_on_exec support for sockets only. Inside of fhandler_socket.cc , edit the fcntl(..) function and add this to the switch statement: case F_SETFD: { // the default handler is broken for now // should send -1 but have to lie to vtwm so send 0 res = 0; break; } After I did this, X starts up great and everything is fine except I miss my KDE ;-) Of course, your mileage may vary, and I advise that this bug be sent to the real developers of the cygwin kernel so they can fix it properly. This should be considered a temporary work around! -Mark Oskin """ -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple