]> git.openfabrics.org - ~shefty/librdmacm.git/commitdiff
rspreload: Fix checks in fork_active
authorSean Hefty <sean.hefty@intel.com>
Mon, 20 Aug 2012 16:06:49 +0000 (09:06 -0700)
committerSean Hefty <sean.hefty@intel.com>
Mon, 20 Aug 2012 16:06:49 +0000 (09:06 -0700)
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
src/preload.c

index 8f19af59866d1a2e2068997abeddca8fec75932f..474287e8c848bc5a7486f7f2b433c1c8046ae212 100644 (file)
@@ -520,7 +520,7 @@ static void fork_active(int socket)
        if ((ret != sizeof msg) || msg)
                goto err2;
 
-       ret = rconnect(ret, (struct sockaddr *) &addr, len);
+       ret = rconnect(dfd, (struct sockaddr *) &addr, len);
        if (ret)
                goto err2;
 
@@ -618,9 +618,9 @@ static inline enum fd_type fd_fork_get(int index, int *fd)
 
        fdi = idm_lookup(&idm, index);
        if (fdi) {
-               if (fdi->type == fd_fork_passive)
+               if (fdi->state == fd_fork_passive)
                        fork_passive(index);
-               else if (fdi->type == fd_fork_active)
+               else if (fdi->state == fd_fork_active)
                        fork_active(index);
                *fd = fdi->fd;
                return fdi->type;