Diffstat (limited to 'noncore/apps/opie-console/procctl.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/procctl.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/procctl.cpp b/noncore/apps/opie-console/procctl.cpp index a44529b..5239e26 100644 --- a/noncore/apps/opie-console/procctl.cpp +++ b/noncore/apps/opie-console/procctl.cpp | |||
@@ -36,33 +36,36 @@ void ProcCtl::remove( pid_t pi ) { | |||
36 | * is equal to pi the we | 36 | * is equal to pi the we |
37 | * | 37 | * |
38 | */ | 38 | */ |
39 | ProcContainer* con; | 39 | ProcContainer* con; |
40 | if (m_last->pid == pi ) { | 40 | if (m_last->pid == pi ) { |
41 | con = m_last; | 41 | con = m_last; |
42 | m_last = con->prev; | 42 | m_last = con->prev; |
43 | delete con; | 43 | delete con; |
44 | return; | 44 | return; |
45 | } | 45 | } |
46 | 46 | ||
47 | con = m_last; | 47 | con = m_last; |
48 | ProcContainer* forw = 0l; | 48 | ProcContainer* forw = 0l; |
49 | while (con ) { | 49 | while (con ) { |
50 | /* remove it */ | 50 | /* remove it */ |
51 | if ( pi == con->pid ) { | 51 | if ( pi == con->pid ) { |
52 | if (forw) | ||
52 | forw->prev = con->prev; | 53 | forw->prev = con->prev; |
54 | else | ||
55 | forw = con->prev; | ||
53 | delete con; | 56 | delete con; |
54 | return; | 57 | return; |
55 | } | 58 | } |
56 | 59 | ||
57 | forw = con; | 60 | forw = con; |
58 | con = con->prev; | 61 | con = con->prev; |
59 | } | 62 | } |
60 | 63 | ||
61 | } | 64 | } |
62 | void ProcCtl::remove( ProcContainer con ) { | 65 | void ProcCtl::remove( ProcContainer con ) { |
63 | remove( con.pid ); | 66 | remove( con.pid ); |
64 | } | 67 | } |
65 | int ProcCtl::status(pid_t pid )const{ | 68 | int ProcCtl::status(pid_t pid )const{ |
66 | ProcContainer *con = m_last; | 69 | ProcContainer *con = m_last; |
67 | while (con) { | 70 | while (con) { |
68 | if (con->pid == pid ) | 71 | if (con->pid == pid ) |