You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bc...@apache.org on 2017/10/18 16:19:13 UTC

[trafficserver] branch master updated: CID 1196423: Error handling issues (CHECKED_RETURN)

This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 4ebdb40  CID 1196423: Error handling issues  (CHECKED_RETURN)
4ebdb40 is described below

commit 4ebdb4000ec9aca0b64109a5fcd052b70b15f5ff
Author: Oknet Xu <xu...@skyguard.com.cn>
AuthorDate: Tue Oct 17 11:47:15 2017 +0800

    CID 1196423: Error handling issues  (CHECKED_RETURN)
---
 iocore/net/P_UnixNetVConnection.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/iocore/net/P_UnixNetVConnection.h b/iocore/net/P_UnixNetVConnection.h
index ee6bc05..c6ad45e 100644
--- a/iocore/net/P_UnixNetVConnection.h
+++ b/iocore/net/P_UnixNetVConnection.h
@@ -323,7 +323,10 @@ TS_INLINE void
 UnixNetVConnection::set_local_addr()
 {
   int local_sa_size = sizeof(local_addr);
-  safe_getsockname(con.fd, &local_addr.sa, &local_sa_size);
+  // This call will fail if fd is closed already. That is ok, because the
+  // `local_addr` is checked within get_local_addr() and the `got_local_addr`
+  // is set only with a valid `local_addr`.
+  ATS_UNUSED_RETURN(safe_getsockname(con.fd, &local_addr.sa, &local_sa_size));
 }
 
 TS_INLINE ink_hrtime

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].