[all-commits] [llvm/llvm-project] 203232: [llvm][Support] ListeningSocket::accept returns op...

Connor Sughrue via All-commits all-commits at lists.llvm.org
Tue May 21 17:32:33 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 203232ffbd80e9f4631213a3876f14dde155a92d
      https://github.com/llvm/llvm-project/commit/203232ffbd80e9f4631213a3876f14dde155a92d
  Author: Connor Sughrue <55301806+cpsughrue at users.noreply.github.com>
  Date:   2024-05-21 (Tue, 21 May 2024)

  Changed paths:
    M llvm/lib/Support/raw_socket_stream.cpp
    M llvm/unittests/Support/raw_socket_stream_test.cpp

  Log Message:
  -----------
  [llvm][Support] ListeningSocket::accept returns operation_canceled if FD is set to -1 (#89479)

If `::poll` returns and `FD` equals -1, then `ListeningSocket::shutdown`
has been called. So, regardless of any other information that could be
gleaned from `FDs.revents` or `PollStatus`, it is appropriate to return
`std::errc::operation_canceled`. `ListeningSocket::shutdown` copies
`FD`'s value to `ObservedFD` then sets `FD` to -1 before canceling
`::poll` by calling `::close(ObservedFD)` and writing to the pipe.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list