diff options
Diffstat (limited to 'kernel/features/proc.c')
-rw-r--r-- | kernel/features/proc.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/kernel/features/proc.c b/kernel/features/proc.c index aab4fec..3f8dcf1 100644 --- a/kernel/features/proc.c +++ b/kernel/features/proc.c @@ -111,10 +111,11 @@ struct proc_message *proc_receive(struct proc *proc) struct proc *proc_from_pid(u32 pid) { struct node *iterator = proc_list->head; - do { + while (iterator != NULL) { if (((struct proc *)iterator->data)->pid == pid) return iterator->data; - } while ((iterator = iterator->next) != NULL); + iterator = iterator->next; + } return NULL; } @@ -124,13 +125,14 @@ void proc_exit(struct proc *proc, int status) int res = 0; struct node *iterator = proc_list->head; - do { + while (iterator != NULL) { if (iterator->data == proc) { res = 1; list_remove(proc_list, iterator); break; } - } while ((iterator = iterator->next) != NULL); + iterator = iterator->next; + } if (memcmp(proc, current->data, sizeof(*proc)) == 0) current = NULL; |