mgorny added inline comments.

================
Comment at: lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp:647
 
+  uint16_t port = listening_socket.get()->GetLocalPortNumber();
+  socket_id_callback(port != 0 ? std::to_string(port) : "");
----------------
labath wrote:
> mgorny wrote:
> > labath wrote:
> > > Can this ever be zero ?
> > Yes, when `getsockname()` fails. I suppose we could modify it to use 
> > `llvm::Optional<...>` or even `llvm::Expected<...>` but this is one place 
> > where I don't think we need to care much about proper error handling.
> But how can it fail? This is a socket that we've just created and its totally 
> under our control...
Yeah, exactly, that's why I said proper error handling is not very important 
there — but technically the function provides some potential error conditions. 
Are you suggesting we just pass zero as-is then?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111964/new/

https://reviews.llvm.org/D111964

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to