patch-2.4.0-test7 linux/fs/proc/array.c

Next file: linux/fs/proc/base.c
Previous file: linux/fs/pipe.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test6/linux/fs/proc/array.c linux/fs/proc/array.c
@@ -301,12 +301,11 @@
 {
 	unsigned long vsize, eip, esp, wchan;
 	long priority, nice;
-	int tty_pgrp;
+	int tty_pgrp = -1, tty_nr = 0;
 	sigset_t sigign, sigcatch;
 	char state;
 	int res;
 	pid_t ppid;
-	int tty_nr;
 	struct mm_struct *mm;
 
 	state = *get_task_state(task);
@@ -315,6 +314,10 @@
 	mm = task->mm;
 	if(mm)
 		atomic_inc(&mm->mm_users);
+	if (task->tty) {
+		tty_pgrp = task->tty->pgrp;
+		tty_nr = kdev_t_to_nr(task->tty->device);
+	}
 	task_unlock(task);
 	if (mm) {
 		struct vm_area_struct *vma;
@@ -332,14 +335,6 @@
 	wchan = get_wchan(task);
 
 	collect_sigign_sigcatch(task, &sigign, &sigcatch);
-
-	task_lock(task);
-	if (task->tty)
-		tty_pgrp = task->tty->pgrp;
-	else
-		tty_pgrp = -1;
-	tty_nr = task->tty ? kdev_t_to_nr(task->tty->device) : 0;
-	task_unlock(task);
 
 	/* scale priority and nice values from timeslices to -20..20 */
 	/* to make it look like a "normal" Unix priority/nice value  */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)