summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/procctl.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-console/procctl.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/procctl.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/procctl.cpp b/noncore/apps/opie-console/procctl.cpp
index ff6bea8..a44529b 100644
--- a/noncore/apps/opie-console/procctl.cpp
+++ b/noncore/apps/opie-console/procctl.cpp
@@ -1,43 +1,44 @@
#include <sys/wait.h>
#include <fcntl.h>
#include <unistd.h>
#include "procctl.h"
ProcContainer *ProcCtl::m_last = 0;
ProcCtl* ProcCtl::m_self = 0;
ProcCtl::ProcCtl() {
signal( SIGCHLD, signal_handler );
}
ProcCtl::~ProcCtl() {
}
ProcCtl* ProcCtl::self() {
if (!m_self ) {
m_self = new ProcCtl;
}
+ return m_self;
}
void ProcCtl::add(pid_t pi, int fd ) {
ProcContainer * con = new ProcContainer;
//memset(con, 0, sizeof(con) );
con->pid = pi;
con->fd = fd;
con->status = 0;
con->prev = m_last;
m_last = con;
}
void ProcCtl::remove( pid_t pi ) {
/*
* We first check if the last item
* is equal to pi the we
*
*/
ProcContainer* con;
if (m_last->pid == pi ) {
con = m_last;
m_last = con->prev;
delete con;
return;