[Lldb-commits] [PATCH] D88728: [lldb] Check for and use ptsname_r if available

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Oct 2 06:30:30 PDT 2020


labath added inline comments.


================
Comment at: lldb/source/Host/common/PseudoTerminal.cpp:149
+  int r = ptsname_r(m_primary_fd, buf, sizeof(buf));
+  assert(r == 0);
+  return buf;
----------------
mgorny wrote:
> I would really feel better with a real error handling here. It shouldn't be hard to use `ErrorOr` here.
Yeah, but what are you going to do with that value? Pass it to the caller? The existing callers are ignoring the error return anyway, and I don't want to add error handling everywhere as afaict, this function can't fail unless the user messes up the master state (which is not something I want to support).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88728



More information about the lldb-commits mailing list