GNetworkMonitorNetlink: make the netlink socket cloexec

Use the same code GSocket does, to try SOCK_CLOEXEC first, and then
fall back to FD_CLOEXEC if it fails. (And fix that code to not call
fcntl if SOCK_CLOEXEC worked.)

https://bugzilla.gnome.org/show_bug.cgi?id=692332
This commit is contained in:
Dan Winship
2013-01-22 16:39:49 -05:00
parent 2476dd24d7
commit 5932e16acd
3 changed files with 57 additions and 36 deletions

View File

@@ -34,6 +34,11 @@ gchar * _g_uri_from_authority (const gchar *protocol,
guint port,
const gchar *userinfo);
gint g_socket (gint domain,
gint type,
gint protocol,
GError **error);
G_END_DECLS
#endif /* __G_NETWORKINGPRIVATE_H__ */