www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1999/11/24/19:24:21

Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-developers-unsubscribe-archive-cygwin-developers=delorie DOT com AT sourceware DOT cygnus DOT com>
List-Subscribe: <mailto:cygwin-developers-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-developers-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-developers-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin-developers AT sourceware DOT cygnus DOT com
From: Chris Faylor <cgf AT cygnus DOT com>
Date: Wed, 24 Nov 1999 19:24:13 -0500
To: Kazuhiro Fujieda <fujieda AT jaist DOT ac DOT jp>
Cc: cygwin-developers AT sourceware DOT cygnus DOT com
Subject: Re: cygwin_bind bug.
Message-ID: <19991124192413.A12159@cygnus.com>
Mail-Followup-To: Kazuhiro Fujieda <fujieda AT jaist DOT ac DOT jp>,
cygwin-developers AT sourceware DOT cygnus DOT com
References: <s1s903npgry DOT fsf AT jaist DOT ac DOT jp>
Mime-Version: 1.0
X-Mailer: Mutt 1.0i
In-Reply-To: <s1s903npgry.fsf@jaist.ac.jp>; from fujieda@jaist.ac.jp on Thu, Nov 25, 1999 at 09:16:17AM +0900

Is this patch against the latest snapshot?  Corinna has submitted
some changes to some of this code recently.  It is in the latest
snapshot.

cgf

On Thu, Nov 25, 1999 at 09:16:17AM +0900, Kazuhiro Fujieda wrote:
>cygwin_bind() with AF_UNIX can return 0 even though it fails.
>
>ChangeLog:
>Thu Nov 25 08:55:42 1999  Kazuhiro Fujieda <fujieda AT jaist DOT ac DOT jp>
>	* net.cc (cygwin_bind): Return -1 properly if it fails on AF_UNIX.
>
>--- net.cc-	Thu Nov 25 08:31:53 1999
>+++ net.cc	Thu Nov 25 08:55:42 1999
>@@ -757,6 +757,7 @@ cygwin_bind (int fd, struct sockaddr *my
> 	  struct sockaddr_in sin;
> 	  int len = sizeof sin;
> 	  int fd;
>+	  int inet_res;
> 
>           if (strlen (un_addr->sun_path) >= UNIX_PATH_LEN)
>             {
>@@ -766,15 +767,15 @@ cygwin_bind (int fd, struct sockaddr *my
> 	  sin.sin_family = AF_INET;
> 	  sin.sin_port = 0;
> 	  sin.sin_addr.s_addr = htonl (INADDR_LOOPBACK);
>-	  res = bind (sock->get_socket (), (sockaddr *) &sin, len);
>-	  if (res)
>+	  inet_res = bind (sock->get_socket (), (sockaddr *) &sin, len);
>+	  if (inet_res)
> 	    {
> 	      set_winsock_errno ();
> 	      syscall_printf ("AF_UNIX: bind failed %d", get_errno ());
> 	      goto out;
> 	    }
>-	  res = getsockname (sock->get_socket (), (sockaddr *) &sin, &len);
>-	  if (res)
>+	  inet_res = getsockname (sock->get_socket (), (sockaddr *) &sin, &len);
>+	  if (inet_res)
> 	    {
> 	      set_winsock_errno ();
> 	      syscall_printf ("AF_UNIX: getsockname failed %d", get_errno ());
>
>____
>  | AIST      Kazuhiro Fujieda <fujieda AT jaist DOT ac DOT jp>
>  | HOKURIKU  School of Information Science
>o_/ 1990      Japan Advanced Institute of Science and Technology

-- 
cgf AT cygnus DOT com
http://www.cygnus.com/

- Raw text -


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