[ofa-general] [PATCH 1/1] sdplib - bind returns wrong error when using 'both'

Jim Mott jim at mellanox.com
Tue Feb 12 11:54:27 PST 2008


A Mellanox regression test detected a difference between the error
returned by SDP and TCP and the error returned using libsdp with
'both'.
    
Signed-off-by: Jim Mott <jim at mellanox.com>
---

Index: ofa_1_3_dev_user/src/userspace/libsdp/src/port.c
===================================================================
--- ofa_1_3_dev_user.orig/src/userspace/libsdp/src/port.c
2008-02-12 00:32:08.000000000 -0600
+++ ofa_1_3_dev_user/src/userspace/libsdp/src/port.c    2008-02-12
13:11:01.000000000 -0600
@@ -1170,6 +1170,11 @@
                                          "binding SDP socket
failed:%s\n", strerror( errno ) );
                _socket_funcs.close( *sdp_sd );
                _socket_funcs.close( *tcp_sd );
+
+               /* TCP and SDP without library return EINVAL */
+               if (errno == EADDRINUSE)
+                       errno = EINVAL;
+
                goto done;
        }



More information about the general mailing list