mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 18:02:05 -05:00
Kernel/TTY: Don't return NonnullLockRefPtr when creating MasterPTY
We can just return a normal NonnullRefPtr because nobody needs an actual *LockRefPtrs here anymore.
This commit is contained in:
parent
82428e2a05
commit
b49f2937f0
2 changed files with 4 additions and 4 deletions
|
@ -16,12 +16,12 @@
|
|||
|
||||
namespace Kernel {
|
||||
|
||||
ErrorOr<NonnullLockRefPtr<MasterPTY>> MasterPTY::try_create(unsigned int index)
|
||||
ErrorOr<NonnullRefPtr<MasterPTY>> MasterPTY::try_create(unsigned int index)
|
||||
{
|
||||
auto buffer = TRY(DoubleBuffer::try_create("MasterPTY: Buffer"sv));
|
||||
auto master_pty = TRY(adopt_nonnull_lock_ref_or_enomem(new (nothrow) MasterPTY(index, move(buffer))));
|
||||
auto master_pty = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) MasterPTY(index, move(buffer))));
|
||||
auto credentials = Process::current().credentials();
|
||||
auto slave_pty = TRY(adopt_nonnull_lock_ref_or_enomem(new (nothrow) SlavePTY(*master_pty, credentials->uid(), credentials->gid(), index)));
|
||||
auto slave_pty = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) SlavePTY(*master_pty, credentials->uid(), credentials->gid(), index)));
|
||||
master_pty->m_slave.with([&slave_pty](auto& slave) {
|
||||
slave = *slave_pty;
|
||||
});
|
||||
|
|
|
@ -16,7 +16,7 @@ class SlavePTY;
|
|||
|
||||
class MasterPTY final : public CharacterDevice {
|
||||
public:
|
||||
static ErrorOr<NonnullLockRefPtr<MasterPTY>> try_create(unsigned index);
|
||||
static ErrorOr<NonnullRefPtr<MasterPTY>> try_create(unsigned index);
|
||||
virtual ~MasterPTY() override;
|
||||
|
||||
unsigned index() const { return m_index; }
|
||||
|
|
Loading…
Add table
Reference in a new issue