summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/procctl.cpp6
-rw-r--r--noncore/apps/opie-console/procctl.h5
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
@@ -1,26 +1,32 @@
#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;
+ }
+}
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 ) {
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
@@ -8,26 +8,29 @@
#include <qmap.h>
struct ProcContainer {
pid_t pid;
int fd;
int status;
ProcContainer* prev;
};
class ProcCtl {
-public:
+private:
ProcCtl();
+public:
~ProcCtl();
+ ProcCtl* self();
int status(pid_t)const;
void add( pid_t, int fd );
void remove( pid_t );
void remove( ProcContainer );
private:
static void signal_handler(int);
static ProcContainer* m_last;
+ static ProcCtl* m_self;
};
#endif