diff -Naur uwsgi-0.9.6.5/utils.c uwsgi-0.9.6.5.patched/utils.c
--- uwsgi-0.9.6.5/utils.c	2010-09-29 07:57:43.000000000 +0200
+++ uwsgi-0.9.6.5.patched/utils.c	2010-10-06 12:28:38.000000000 +0200
@@ -365,6 +365,10 @@
                 return -1;
 	}
 
+	if (uwsgi.close_on_exec) {
+        	fcntl(wsgi_req->poll.fd, F_SETFD, FD_CLOEXEC);
+        }
+
 	return 0;
 }
 
diff -Naur uwsgi-0.9.6.5/uwsgi.c uwsgi-0.9.6.5.patched/uwsgi.c
--- uwsgi-0.9.6.5/uwsgi.c	2010-09-29 07:57:43.000000000 +0200
+++ uwsgi-0.9.6.5.patched/uwsgi.c	2010-10-06 12:28:07.000000000 +0200
@@ -170,6 +170,7 @@
 		{"http-var", required_argument, 0, LONG_ARGS_HTTP_VAR},
 #endif
 		{"catch-exceptions", no_argument, &uwsgi.catch_exceptions, 1},
+		{"close-on-exec", no_argument, &uwsgi.close_on_exec, 1},
 		{"mode", required_argument, 0, LONG_ARGS_MODE},
 		{"env", required_argument, 0, LONG_ARGS_ENV},
 		{"vacuum", no_argument, &uwsgi.vacuum, 1},
diff -Naur uwsgi-0.9.6.5/uwsgi.h uwsgi-0.9.6.5.patched/uwsgi.h
--- uwsgi-0.9.6.5/uwsgi.h	2010-09-29 07:57:43.000000000 +0200
+++ uwsgi-0.9.6.5.patched/uwsgi.h	2010-10-06 12:27:12.000000000 +0200
@@ -723,6 +723,8 @@
 	int log_zero_headers;
 	int log_empty_body;
 	int log_high_memory;
+
+	int close_on_exec;
 };
 
 struct uwsgi_cluster_node {
