]> git.neil.brown.name Git - history.git/commitdiff
Fix sigio process lookup handling
authorLinus Torvalds <torvalds@home.transmeta.com>
Thu, 3 Oct 2002 15:18:42 +0000 (08:18 -0700)
committerLinus Torvalds <torvalds@penguin.transmeta.com>
Thu, 3 Oct 2002 15:18:42 +0000 (08:18 -0700)
fs/fcntl.c

index 44afb222b22f13eb78153082f86da5ac6fd0d404..539711ef10612482b5719a3f599f88e9097635b1 100644 (file)
@@ -481,8 +481,6 @@ static void send_sigio_to_task(struct task_struct *p,
 void send_sigio(struct fown_struct *fown, int fd, int band)
 {
        struct task_struct *p;
-       struct list_head *l;
-       struct pid *pidptr;
        int pid;
        
        read_lock(&fown->lock);
@@ -492,10 +490,13 @@ void send_sigio(struct fown_struct *fown, int fd, int band)
        
        read_lock(&tasklist_lock);
        if (pid > 0) {
-               if (p = find_task_by_pid(pid)) {
+               p = find_task_by_pid(pid);
+               if (p) {
                        send_sigio_to_task(p, fown, fd, band);
                }
        } else {
+               struct list_head *l;
+               struct pid *pidptr;
                for_each_task_pid(-pid, PIDTYPE_PGID, p, l, pidptr) {
                        send_sigio_to_task(p, fown, fd, band);
                }
@@ -526,10 +527,13 @@ int send_sigurg(struct fown_struct *fown)
        
        read_lock(&tasklist_lock);
        if (pid > 0) {
-               if (p = find_task_by_pid(pid)) {
+               p = find_task_by_pid(pid);
+               if (p) {
                        send_sigurg_to_task(p, fown);
                }
        } else {
+               struct list_head *l;
+               struct pid *pidptr;
                for_each_task_pid(-pid, PIDTYPE_PGID, p, l, pidptr) {
                        send_sigurg_to_task(p, fown);
                }