Skip to contentSkip to conversation

Set close-on-exec flag for datagram sockets

PATCH New Yosuke Iwamatsu 1 participant 1 message Apr 1, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Set close-on-exec flag for datagram sockets

Set the close-on-exec flag for datagram sockets.
We need to close the socket on the child side when xend creates a child process such as qemu-dm.

tools/python/xen/web/connection.py +2 -0
diff -r d5ddc782bc49 tools/python/xen/web/connection.py
@@ -317,6 +317,8 @@
 
     def main(self):
         try:
+            fcntl.fcntl(self.sock.fileno(), fcntl.F_SETFD, fcntl.FD_CLOEXEC)
+
             while True:
                 try:
                     data = self.sock.recv(BUFFER_SIZE)