commit-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[hurd] 28/30: Turn EADDRNOTAVAIL to more commonly-understood ECONNREFUSE


From: Samuel Thibault
Subject: [hurd] 28/30: Turn EADDRNOTAVAIL to more commonly-understood ECONNREFUSED
Date: Tue, 22 Sep 2015 21:52:00 +0000

This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch upstream
in repository hurd.

commit 51f60c38c8d3cae7b0d75ba51eab5af47f6b5df7
Author: Samuel Thibault <address@hidden>
Date:   Sat Sep 12 14:08:17 2015 +0200

    Turn EADDRNOTAVAIL to more commonly-understood ECONNREFUSED
    
    Thanks Svante Signell for the investigation.
    
    * pflocal/socket.c (S_socket_connect, S_socket_send): When addr_get_sock
    returns EADDRNOTAVAIL, translate into ECONNREFUSED.
---
 pflocal/socket.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/pflocal/socket.c b/pflocal/socket.c
index 792c637..5844904 100644
--- a/pflocal/socket.c
+++ b/pflocal/socket.c
@@ -92,7 +92,10 @@ S_socket_connect (struct sock_user *user, struct addr *addr)
     return EOPNOTSUPP;
 
   err = addr_get_sock (addr, &peer);
-  if (!err)
+  if (err == EADDRNOTAVAIL)
+    /* The server went away.  */
+    err = ECONNREFUSED;
+  else if (!err)
     {
       struct sock *sock = user->sock;
       struct connq *cq = peer->listen_queue;
@@ -295,6 +298,9 @@ S_socket_send (struct sock_user *user, struct addr 
*dest_addr, int flags,
   if (dest_addr)
     {
       err = addr_get_sock (dest_addr, &dest_sock);
+      if (err == EADDRNOTAVAIL)
+       /* The server went away.  */
+       err = ECONNREFUSED;
       if (err)
        return err;
       if (sock->pipe_class != dest_sock->pipe_class)

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-hurd/hurd.git



reply via email to

[Prev in Thread] Current Thread [Next in Thread]