Send connman mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.01.org/mailman/listinfo/connman
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of connman digest..."


Today's Topics:

   1. [PATCH] gweb: Remove multiple return and close() statements
      in resolver code (Milind Ramesh Murhekar)


----------------------------------------------------------------------

Message: 1
Date: Fri, 11 Mar 2016 14:07:24 +0530
From: Milind Ramesh Murhekar <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: [PATCH] gweb: Remove multiple return and close() statements
        in resolver code
Message-ID: <[email protected]>

Description: This patch removes the multiple return and close()
statements instead to use single line of code, as per connman coding style
---
 gweb/gresolv.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/gweb/gresolv.c b/gweb/gresolv.c
index 5cf7a9a..8a51a9f 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);
 }
 
-- 
1.9.1



------------------------------

Subject: Digest Footer

_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman


------------------------------

End of connman Digest, Vol 5, Issue 14
**************************************

Reply via email to