aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/kernel/reboot.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/kernel/reboot.c')
-rw-r--r--arch/um/kernel/reboot.c35
1 files changed, 14 insertions, 21 deletions
diff --git a/arch/um/kernel/reboot.c b/arch/um/kernel/reboot.c
index ced8903921ae..9bdf67a092a5 100644
--- a/arch/um/kernel/reboot.c
+++ b/arch/um/kernel/reboot.c
@@ -15,28 +15,21 @@ void (*pm_power_off)(void);
15 15
16static void kill_off_processes(void) 16static void kill_off_processes(void)
17{ 17{
18 if (proc_mm) 18 struct task_struct *p;
19 /* 19 int pid;
20 * FIXME: need to loop over userspace_pids 20
21 */ 21 read_lock(&tasklist_lock);
22 os_kill_ptraced_process(userspace_pid[0], 1); 22 for_each_process(p) {
23 else { 23 struct task_struct *t;
24 struct task_struct *p; 24
25 int pid; 25 t = find_lock_task_mm(p);
26 26 if (!t)
27 read_lock(&tasklist_lock); 27 continue;
28 for_each_process(p) { 28 pid = t->mm->context.id.u.pid;
29 struct task_struct *t; 29 task_unlock(t);
30 30 os_kill_ptraced_process(pid, 1);
31 t = find_lock_task_mm(p);
32 if (!t)
33 continue;
34 pid = t->mm->context.id.u.pid;
35 task_unlock(t);
36 os_kill_ptraced_process(pid, 1);
37 }
38 read_unlock(&tasklist_lock);
39 } 31 }
32 read_unlock(&tasklist_lock);
40} 33}
41 34
42void uml_cleanup(void) 35void uml_cleanup(void)