oops - reverse test for isrun
authorMarc Teitelbaum <marc@ucbvax.Berkeley.EDU>
Fri, 8 Feb 1991 02:45:42 +0000 (18:45 -0800)
committerMarc Teitelbaum <marc@ucbvax.Berkeley.EDU>
Fri, 8 Feb 1991 02:45:42 +0000 (18:45 -0800)
SCCS-vsn: usr.bin/w/proc_compare.c 5.4

usr/src/usr.bin/w/proc_compare.c

index 184f1c8..925c73e 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)proc_compare.c     5.3 (Berkeley) %G%";
+static char sccsid[] = "@(#)proc_compare.c     5.4 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -38,9 +38,9 @@ static char sccsid[] = "@(#)proc_compare.c    5.3 (Berkeley) %G%";
 #define isrun(p)       (((p)->p_stat == SRUN) || ((p)->p_stat == SIDL))
 
 #define        TESTAB(a, b)    ((a)<<1 | (b))
 #define isrun(p)       (((p)->p_stat == SRUN) || ((p)->p_stat == SIDL))
 
 #define        TESTAB(a, b)    ((a)<<1 | (b))
-#define        ONLYA   0x10
-#define        ONLYB   0x01
-#define        BOTH    0x11
+#define        ONLYA   2
+#define        ONLYB   1
+#define        BOTH    3
 
 proc_compare(p1, p2)
        register struct proc *p1, *p2;
 
 proc_compare(p1, p2)
        register struct proc *p1, *p2;
@@ -53,9 +53,9 @@ proc_compare(p1, p2)
         */
        switch (TESTAB(isrun(p1), isrun(p2))) {
        case ONLYA:
         */
        switch (TESTAB(isrun(p1), isrun(p2))) {
        case ONLYA:
-               return (1);
-       case ONLYB:
                return (0);
                return (0);
+       case ONLYB:
+               return (1);
        case BOTH:
                /*
                 * tie - favor one with highest recent cpu utilization
        case BOTH:
                /*
                 * tie - favor one with highest recent cpu utilization