summaryrefslogtreecommitdiff
path: root/gweb
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2011-10-23 12:16:27 (GMT)
committerMarcel Holtmann <marcel@holtmann.org>2011-10-25 11:35:32 (GMT)
commitc3588737d1fc93609d4101fa49aed3217503eef7 (patch)
treeaeeb96c7097757a4b444f75b2ca8122b80fdb394 /gweb
parentd997ab9aa2dab15d486b3836e5dc04ae23fefdc0 (diff)
downloadconnman-c3588737d1fc93609d4101fa49aed3217503eef7.zip
connman-c3588737d1fc93609d4101fa49aed3217503eef7.tar.gz
connman-c3588737d1fc93609d4101fa49aed3217503eef7.tar.bz2
gweb: Add SOCK_CLOEXEC to socket()
Make sure all file descriptor are closed.
Diffstat (limited to 'gweb')
-rw-r--r--gweb/gresolv.c3
-rw-r--r--gweb/gweb.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/gweb/gresolv.c b/gweb/gresolv.c
index 0e7a755..326b5f9 100644
--- a/gweb/gresolv.c
+++ b/gweb/gresolv.c
@@ -161,7 +161,8 @@ static void find_srcaddr(struct sort_result *res)
socklen_t sl = sizeof(res->src);
int fd;
- fd = socket(res->dst.sa.sa_family, SOCK_DGRAM, IPPROTO_IP);
+ fd = socket(res->dst.sa.sa_family, SOCK_DGRAM | SOCK_CLOEXEC,
+ IPPROTO_IP);
if (fd < 0)
return;
diff --git a/gweb/gweb.c b/gweb/gweb.c
index 34288bf..b7cfe62 100644
--- a/gweb/gweb.c
+++ b/gweb/gweb.c
@@ -905,7 +905,8 @@ static int connect_session_transport(struct web_session *session)
GIOFlags flags;
int sk;
- sk = socket(session->addr->ai_family, SOCK_STREAM, IPPROTO_TCP);
+ sk = socket(session->addr->ai_family, SOCK_STREAM | SOCK_CLOEXEC,
+ IPPROTO_TCP);
if (sk < 0)
return -EIO;