get rid of unnecessary test
authorKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Wed, 20 Dec 1989 03:38:55 +0000 (19:38 -0800)
committerKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Wed, 20 Dec 1989 03:38:55 +0000 (19:38 -0800)
SCCS-vsn: sys/kern/kern_descrip.c 7.8

usr/src/sys/kern/kern_descrip.c

index 9f34a37..d0b55e3 100644 (file)
@@ -14,7 +14,7 @@
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- *     @(#)kern_descrip.c      7.7 (Berkeley) %G%
+ *     @(#)kern_descrip.c      7.8 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -289,15 +289,15 @@ ufalloc(want, result)
        int *result;
 {
 
        int *result;
 {
 
-       for (; want < NOFILE; want++)
+       for (; want < NOFILE; want++) {
                if (u.u_ofile[want] == NULL) {
                        u.u_pofile[want] = 0;
                        if (want > u.u_lastfile)
                                u.u_lastfile = want;
                if (u.u_ofile[want] == NULL) {
                        u.u_pofile[want] = 0;
                        if (want > u.u_lastfile)
                                u.u_lastfile = want;
-                       if (result)
-                               *result = want;
+                       *result = want;
                        return (0);
                }
                        return (0);
                }
+       }
        return (EMFILE);
 }
 
        return (EMFILE);
 }