X-Git-Url: http://git.tdb.fi/?p=libs%2Fnet.git;a=blobdiff_plain;f=source%2Fnet%2Fsocket.cpp;fp=source%2Fnet%2Fsocket.cpp;h=2a1a71c0a4b3aa404b616f09a7be6e1799660c27;hp=84db6375c5c7b96c0db0a211e6ff201f527a0c49;hb=9d41b029e940bacf17a3c8d7cc06162f0a41b70a;hpb=1ccb251524403a7318908e076c4f805bd3927247 diff --git a/source/net/socket.cpp b/source/net/socket.cpp index 84db637..2a1a71c 100644 --- a/source/net/socket.cpp +++ b/source/net/socket.cpp @@ -29,8 +29,13 @@ Socket::Socket(Family af, int type, int proto): { mode = IO::M_RDWR; - // TODO use SOCK_CLOEXEC on Linux +#ifdef __linux__ + type |= SOCK_CLOEXEC; +#endif priv->handle = socket(family_to_sys(af), type, proto); +#ifndef __linux__ + set_inherit(false); +#endif platform_init(); }