Author: davidxu
Date: Thu Oct  7 13:13:02 2010
New Revision: 213515
URL: http://svn.freebsd.org/changeset/base/213515

Log:
  MFC r213258:
  - kern_sched_rr_get_interval should return interval for thread 1 in
        target process.
  - eliminate a goto.

Modified:
  stable/7/sys/kern/p1003_1b.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/kern/p1003_1b.c
==============================================================================
--- stable/7/sys/kern/p1003_1b.c        Thu Oct  7 12:58:09 2010        
(r213514)
+++ stable/7/sys/kern/p1003_1b.c        Thu Oct  7 13:13:02 2010        
(r213515)
@@ -219,10 +219,8 @@ sched_getscheduler(struct thread *td, st
                PROC_LOCK(targetp);
        } else {
                targetp = pfind(uap->pid);
-               if (targetp == NULL) {
-                       e = ESRCH;
-                       goto done2;
-               }
+               if (targetp == NULL)
+                       return (ESRCH);
                targettd = FIRST_THREAD_IN_PROC(targetp); /* XXXKSE */
        }
 
@@ -233,7 +231,6 @@ sched_getscheduler(struct thread *td, st
        }
        PROC_UNLOCK(targetp);
 
-done2:
        return (e);
 }
 
@@ -293,13 +290,10 @@ kern_sched_rr_get_interval(struct thread
                targetp = td->td_proc;
                PROC_LOCK(targetp);
        } else {
-               targetp = td->td_proc;
-               PROC_LOCK(targetp);
-               targettd = thread_find(targetp, pid);
-               if (targettd == NULL) {
-                       PROC_UNLOCK(targetp);
+               targetp = pfind(pid);
+               if (targetp == NULL)
                        return (ESRCH);
-               }
+               targettd = FIRST_THREAD_IN_PROC(targetp);
        }
 
        e = p_cansee(td, targetp);
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to