Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin-developers AT sourceware DOT cygnus DOT com Message-ID: <383D046F.FF903EF8@vinschen.de> Date: Thu, 25 Nov 1999 10:42:07 +0100 From: Corinna Vinschen X-Mailer: Mozilla 4.6 [en] (WinNT; I) X-Accept-Language: de,en MIME-Version: 1.0 To: Chris Faylor CC: Kazuhiro Fujieda , cygwin-developers AT sourceware DOT cygnus DOT com Subject: Re: cygwin_bind bug. References: <19991124192413 DOT A12159 AT cygnus DOT com> <19991124205652 DOT B15777 AT cygnus DOT com> <19991124213743 DOT A16356 AT cygnus DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Chris Faylor wrote: > > On Thu, Nov 25, 1999 at 11:28:38AM +0900, Kazuhiro Fujieda wrote: > >>>> On Wed, 24 Nov 1999 20:56:52 -0500 > >>>> Chris Faylor said: > > > >> In that case, why even use an intermediate variable? Why not just check > >> the results from bind and getsockname directly? > >[...] Ooops, I see. It's my fault. I have erased one line in Sergeys code that sets res to -1. The original code sets res to -1 before calling _open. Sorry guys. Patch (according to Sergeys orig. code): --- SNIP --- Index: net.cc =================================================================== RCS file: /src/cvsroot/winsup-991123/net.cc,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 net.cc --- net.cc 1999/11/24 23:07:08 1.1.1.1 +++ net.cc 1999/11/25 09:40:34 @@ -786,6 +786,7 @@ cygwin_bind (int fd, struct sockaddr *my /* bind must fail if file system socket object already exists so _open() is called with O_EXCL flag. */ + res = -1; fd = _open (un_addr->sun_path, O_WRONLY | O_CREAT | O_EXCL | O_BINARY, 0); --- SNAP --- Bye, Corinna