mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-03-23 13:57:04 +00:00
LibCore: Add fd() and notifier() accessors to Core::Stream::LocalSocket
This commit is contained in:
@@ -678,6 +678,13 @@ ErrorOr<Bytes> LocalSocket::read_without_waiting(Bytes buffer)
|
||||
return m_helper.read(buffer, MSG_DONTWAIT);
|
||||
}
|
||||
|
||||
Optional<int> LocalSocket::fd() const
|
||||
{
|
||||
if (!is_open())
|
||||
return {};
|
||||
return m_helper.fd();
|
||||
}
|
||||
|
||||
ErrorOr<int> LocalSocket::release_fd()
|
||||
{
|
||||
if (!is_open()) {
|
||||
|
||||
@@ -468,6 +468,9 @@ public:
|
||||
/// already closed.
|
||||
ErrorOr<int> release_fd();
|
||||
|
||||
Optional<int> fd() const;
|
||||
RefPtr<Core::Notifier> notifier() { return m_helper.notifier(); }
|
||||
|
||||
virtual ~LocalSocket() { close(); }
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user