X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Flinux%2Fdevice.c;h=f50ff1123be023261f23ac52deed8063309f906f;hp=c06e7b93940b29812a7feb3a101e3e77e995dcf0;hb=708314df2f61675d0f54e541c9fff62ac1f433b5;hpb=178e52f76ef4ba40748c13ea7e518837394d6dbc diff --git a/src/linux/device.c b/src/linux/device.c index c06e7b93..f50ff112 100644 --- a/src/linux/device.c +++ b/src/linux/device.c @@ -1,7 +1,7 @@ /* device.c -- Interaction with Linux ethertap and tun/tap device Copyright (C) 2001-2005 Ivo Timmermans, - 2001-2011 Guus Sliepen + 2001-2012 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -72,6 +72,10 @@ static bool setup_device(void) { return false; } +#ifdef FD_CLOEXEC + fcntl(device_fd, F_SETFD, FD_CLOEXEC); +#endif + #ifdef HAVE_LINUX_IF_TUN_H /* Ok now check if this is an old ethertap or a new tun/tap thingie */