]> git.openfabrics.org - ~shefty/librdmacm.git/commitdiff
Refresh of dup2
authorSean Hefty <sean.hefty@intel.com>
Mon, 6 Aug 2012 23:38:03 +0000 (16:38 -0700)
committerSean Hefty <sean.hefty@intel.com>
Mon, 6 Aug 2012 23:38:03 +0000 (16:38 -0700)
src/preload.c

index b3cf6acc7c1319bf01b8f21cb260c15a2b9adf53..085e8b4c63beccce53efaa51584077f170f1a6a1 100644 (file)
@@ -922,6 +922,9 @@ int dup2(int oldfd, int newfd)
        int ret;
 
        oldfdi = idm_lookup(&idm, oldfd);
+       if (oldfdi && oldfdi->type == fd_fork)
+               fork_passive(oldfd);
+
        newfdi = idm_lookup(&idm, newfd);
        if (newfdi) {
                 /* newfd cannot have been dup'ed directly */