-rw-r--r-- | noncore/apps/opie-console/procctl.cpp | 6 | ||||
-rw-r--r-- | noncore/apps/opie-console/procctl.h | 5 |
2 files changed, 10 insertions, 1 deletions
diff --git a/noncore/apps/opie-console/procctl.cpp b/noncore/apps/opie-console/procctl.cpp index 6839a84..ff6bea8 100644 --- a/noncore/apps/opie-console/procctl.cpp +++ b/noncore/apps/opie-console/procctl.cpp @@ -8,2 +8,3 @@ ProcContainer *ProcCtl::m_last = 0; +ProcCtl* ProcCtl::m_self = 0; @@ -14,2 +15,7 @@ ProcCtl::~ProcCtl() { } +ProcCtl* ProcCtl::self() { + if (!m_self ) { + m_self = new ProcCtl; + } +} void ProcCtl::add(pid_t pi, int fd ) { diff --git a/noncore/apps/opie-console/procctl.h b/noncore/apps/opie-console/procctl.h index e2161f3..5e96423 100644 --- a/noncore/apps/opie-console/procctl.h +++ b/noncore/apps/opie-console/procctl.h @@ -19,6 +19,8 @@ struct ProcContainer { class ProcCtl { -public: +private: ProcCtl(); +public: ~ProcCtl(); + ProcCtl* self(); int status(pid_t)const; @@ -30,2 +32,3 @@ private: static ProcContainer* m_last; + static ProcCtl* m_self; }; |