]> git.sesse.net Git - vlc/commitdiff
Set close-on-exec flag on sockets so that we don't pass them to CGI scripts
authorRémi Denis-Courmont <rem@videolan.org>
Wed, 12 Apr 2006 19:25:59 +0000 (19:25 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Wed, 12 Apr 2006 19:25:59 +0000 (19:25 +0000)
src/network/io.c

index 3403ed52e1f8fcadf2cf4a858c0d394d0dc6f374..8266081fd1d25c23b5c852c1c49d0279a3779d39 100644 (file)
@@ -77,6 +77,8 @@ int net_Socket( vlc_object_t *p_this, int i_family, int i_socktype,
             msg_Err( p_this, "cannot set socket to non-blocking mode" );
     }
 #else
+    fcntl( fd, F_SETFD, FD_CLOEXEC );
+
     if( ( ( i_val = fcntl( fd, F_GETFL, 0 ) ) < 0 ) ||
         ( fcntl( fd, F_SETFL, i_val | O_NONBLOCK ) < 0 ) )
         msg_Err( p_this, "cannot set socket to non-blocking mode (%s)",