mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-21 08:17:29 +08:00
fhandler_socket_wsock::set_socket_handle calls set_flags after setting the O_NONBLOCK/O_CLOEXEC flags, thus overwriting them. It also turns out that fhandler_socket_wsock::init_events is called too late. The inheritence flags are changed before creating the socket event handling objects. Thus, inheritence flags for those objects are wrong with SOCK_CLOEXEC. Fix this by reordering the calls and setting the file flags through fhandler_base::set_flags. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Cygwin documentation is available on the net at https://cygwin.com You might especially be interested in https://cygwin.com/faq/faq.html#faq.programming.building-cygwin