diff options
author | Daniel Wagner <daniel.wagner@bmw-carit.de> | 2011-10-23 14:16:28 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2011-10-25 13:36:12 +0200 |
commit | 244b3b17aa713d6daf70709e105c0e0a1faff78e (patch) | |
tree | 0e96e9a9cdc9a15948ed83deeda47b24df3d4b7d /plugins | |
parent | c3588737d1fc93609d4101fa49aed3217503eef7 (diff) | |
download | connman-244b3b17aa713d6daf70709e105c0e0a1faff78e.tar.gz connman-244b3b17aa713d6daf70709e105c0e0a1faff78e.tar.bz2 connman-244b3b17aa713d6daf70709e105c0e0a1faff78e.zip |
plugins: Add SOCK_CLOEXEC to socket()
Make sure all file descriptor are closed.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/loopback.c | 2 | ||||
-rw-r--r-- | plugins/ntpd.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/plugins/loopback.c b/plugins/loopback.c index 303c54bc..fa3b273c 100644 --- a/plugins/loopback.c +++ b/plugins/loopback.c @@ -133,7 +133,7 @@ static int setup_loopback(void) struct sockaddr_in addr; int sk, err; - sk = socket(PF_INET, SOCK_DGRAM, 0); + sk = socket(PF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0); if (sk < 0) return -errno; diff --git a/plugins/ntpd.c b/plugins/ntpd.c index d437ecbe..7080852b 100644 --- a/plugins/ntpd.c +++ b/plugins/ntpd.c @@ -90,7 +90,7 @@ static connman_bool_t ntpd_running(void) connman_bool_t ret; struct sockaddr_in server_addr; - if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) == -1) + if ((sock = socket(AF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0)) == -1) return FALSE; server_addr.sin_family = AF_INET; |