1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:17:44 +00:00

Kernel: Put a bunch of debug spam behind #ifdefs.

This commit is contained in:
Andreas Kling 2019-03-27 15:07:12 +01:00
parent 56f7b392c1
commit 44e1e7423f
5 changed files with 22 additions and 2 deletions

View file

@ -6,6 +6,8 @@
#include <LibC/signal_numbers.h>
#include <LibC/sys/ioctl_numbers.h>
//#define MASTERPTY_DEBUG
MasterPTY::MasterPTY(unsigned index)
: CharacterDevice(10, index)
, m_slave(adopt(*new SlavePTY(*this, index)))
@ -17,7 +19,9 @@ MasterPTY::MasterPTY(unsigned index)
MasterPTY::~MasterPTY()
{
#ifdef MASTERPTY_DEBUG
dbgprintf("~MasterPTY(%u)\n", m_index);
#endif
PTYMultiplexer::the().notify_master_destroyed(Badge<MasterPTY>(), m_index);
}
@ -55,7 +59,9 @@ bool MasterPTY::can_write(Process&) const
void MasterPTY::notify_slave_closed(Badge<SlavePTY>)
{
#ifdef MASTERPTY_DEBUG
dbgprintf("MasterPTY(%u): slave closed, my retains: %u, slave retains: %u\n", m_index, retain_count(), m_slave->retain_count());
#endif
// +1 retain for my MasterPTY::m_slave
// +1 retain for FileDescriptor::m_device
if (m_slave->retain_count() == 2)