summaryrefslogtreecommitdiff
path: root/client.c
diff options
context:
space:
mode:
authorGDR! <gdr@gdr.name>2015-07-07 19:39:47 +0200
committerGDR! <gdr@gdr.name>2015-07-07 19:39:47 +0200
commit5d387074214a9b9f7437bed4dcc02aab1f9abd7f (patch)
treef52695923803875da1ed81b41043b133364a9804 /client.c
parent8ae485719161a1b1d33c5d777b2b2d4035c9ff06 (diff)
Remaining coverity bugs
Diffstat (limited to 'client.c')
-rw-r--r--client.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/client.c b/client.c
index 6c9217e..fff4620 100644
--- a/client.c
+++ b/client.c
@@ -72,7 +72,7 @@ int local_bind()
72 if(setsockopt_status < 0) 72 if(setsockopt_status < 0)
73 { 73 {
74 log_printf(L_ERROR, "Could not set socket options: %s\n", 74 log_printf(L_ERROR, "Could not set socket options: %s\n",
75 explain_setsockopt(bind_sockfd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int))); 75 strerror(errno));
76 freeaddrinfo(res); 76 freeaddrinfo(res);
77 exit(1); 77 exit(1);
78 } 78 }
@@ -82,7 +82,12 @@ int local_bind()
82 { 82 {
83 flags = 0; 83 flags = 0;
84 } 84 }
85 fcntl(bind_sockfd, F_SETFL, flags | O_NONBLOCK); 85 if(fcntl(bind_sockfd, F_SETFL, flags | O_NONBLOCK) < 0)
86 {
87 log_printf(L_ERROR, "Could not make the socket non-blocking: %s\n", strerror(errno));
88 freeaddrinfo(res);
89 exit(1);
90 }
86 91
87 if(bind(bind_sockfd, res->ai_addr, res->ai_addrlen) < 0) 92 if(bind(bind_sockfd, res->ai_addr, res->ai_addrlen) < 0)
88 { 93 {