Version: 1
-Previous: 76c63745415a52c6b11702275582ad120c688673
-Head: d30bdb2dc3790f8b9ca2b1ee538af60020bc24da
+Previous: be44f7378b7e6e83df983f87e55ae3e14498dd05
+Head: 5185cbcc0ca048c3492ed2af2abfcf5e8810f0a3
Applied:
fork-fix: d30bdb2dc3790f8b9ca2b1ee538af60020bc24da
+ refresh-temp: 5185cbcc0ca048c3492ed2af2abfcf5e8810f0a3
Unapplied:
dbg-fork: 5679a32af8305db3c0406f9abb961259304a384a
af_ib: 2e4bfa467343c57c68616c1922c01765df3ed1db
--- /dev/null
+Bottom: 30191aa638f3f574e67a71c82fa7771bcc620c52
+Top: f28ec49823485e069c95d7c5851dbd01583cf091
+Author: Sean Hefty <sean.hefty@intel.com>
+Date: 2012-08-23 11:31:58 -0700
+
+Refresh of fork-fix
+
+---
+
+diff --git a/src/preload.c b/src/preload.c
+index 0645f6d..4ba38f5 100644
+--- a/src/preload.c
++++ b/src/preload.c
+@@ -412,20 +412,21 @@ int socket(int domain, int type, int protocol)
+ if (index < 0)
+ return index;
+
++ if (fork_support && (domain == PF_INET || domain == PF_INET6) &&
++ (type == SOCK_STREAM) && (!protocol || protocol == IPPROTO_TCP)) {
++ ret = real.socket(domain, type, protocol);
++ if (ret < 0)
++ return ret;
++ fd_store(index, ret, fd_normal, fd_fork);
++ return index;
++ }
++
+ recursive = 1;
+ ret = rsocket(domain, type, protocol);
+ recursive = 0;
+ if (ret >= 0) {
+- if (fork_support) {
+- rclose(ret);
+- ret = real.socket(domain, type, protocol);
+- if (ret < 0)
+- return ret;
+- fd_store(index, ret, fd_normal, fd_fork);
+- } else {
+- fd_store(index, ret, fd_rsocket, fd_ready);
+- set_rsocket_options(ret);
+- }
++ fd_store(index, ret, fd_rsocket, fd_ready);
++ set_rsocket_options(ret);
+ return index;
+ }
+ fd_close(index, &ret);