diff options
author | Milind Ramesh Murhekar <m.murhekar@samsung.com> | 2016-03-11 14:07:24 +0530 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2016-03-22 11:25:41 +0200 |
commit | f1ff51c5a4ba59f3cf208328e1ea09a3a99e3a89 (patch) | |
tree | b2d25d77f99e6a6a016fe72bd8c2741fa7a92490 | |
parent | 24a200efed42325b77512559dd638a548d425791 (diff) | |
download | connman-f1ff51c5a4ba59f3cf208328e1ea09a3a99e3a89.tar.gz |
gweb: Remove multiple return and close() statements in resolver code
Description: This patch removes the multiple return and close()
statements instead to use single line of code, as per connman coding style
-rw-r--r-- | gweb/gresolv.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/gweb/gresolv.c b/gweb/gresolv.c index 5cf7a9a6..8a51a9f6 100644 --- a/gweb/gresolv.c +++ b/gweb/gresolv.c @@ -181,17 +181,15 @@ static void find_srcaddr(struct sort_result *res) if (fd < 0) return; - if (connect(fd, &res->dst.sa, sizeof(res->dst)) < 0) { - close(fd); - return; - } + if (connect(fd, &res->dst.sa, sizeof(res->dst)) < 0) + goto out; - if (getsockname(fd, &res->src.sa, &sl) < 0) { - close(fd); - return; - } + if (getsockname(fd, &res->src.sa, &sl) < 0) + goto out; res->reachable = true; + +out: close(fd); } |