Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3cfd0885 authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds
Browse files

[PATCH] tty: stop the tty vanishing under procfs access



Signed-off-by: default avatarAlan Cox <alan@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 808a0d38
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -347,6 +347,8 @@ static int do_task_stat(struct task_struct *task, char * buffer, int whole)
	sigemptyset(&sigign);
	sigemptyset(&sigcatch);
	cutime = cstime = utime = stime = cputime_zero;

	mutex_lock(&tty_mutex);
	read_lock(&tasklist_lock);
	if (task->sighand) {
		spin_lock_irq(&task->sighand->siglock);
@@ -388,6 +390,7 @@ static int do_task_stat(struct task_struct *task, char * buffer, int whole)
	}
	ppid = pid_alive(task) ? task->group_leader->real_parent->tgid : 0;
	read_unlock(&tasklist_lock);
	mutex_unlock(&tty_mutex);

	if (!whole || num_threads<2)
		wchan = get_wchan(task);