all: use O_CLOEXEC for file descriptors

This commit is contained in:
Thomas Haller
2016-12-10 15:28:15 +01:00
parent e332c27824
commit 4bdee37771
18 changed files with 35 additions and 34 deletions

View File

@@ -5167,7 +5167,7 @@ tun_add (NMPlatform *platform, const char *name, gboolean tap,
_LOGD ("link: add %s '%s' owner %" G_GINT64_FORMAT " group %" G_GINT64_FORMAT,
tap ? "tap" : "tun", name, owner, group);
fd = open ("/dev/net/tun", O_RDWR);
fd = open ("/dev/net/tun", O_RDWR | O_CLOEXEC);
if (fd < 0)
return FALSE;