Module Name: src Committed By: abhinav Date: Thu Apr 27 16:52:22 UTC 2017
Modified Files: src/sys/kern: kern_event.c Log Message: Rearrange the if conditions in order to get rid of unnecessary indentation. No functional change intended. ok christos@ To generate a diff of this commit: cvs rdiff -u -r1.88 -r1.89 src/sys/kern/kern_event.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/kern/kern_event.c diff -u src/sys/kern/kern_event.c:1.88 src/sys/kern/kern_event.c:1.89 --- src/sys/kern/kern_event.c:1.88 Thu Jul 14 18:16:51 2016 +++ src/sys/kern/kern_event.c Thu Apr 27 16:52:22 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_event.c,v 1.88 2016/07/14 18:16:51 christos Exp $ */ +/* $NetBSD: kern_event.c,v 1.89 2017/04/27 16:52:22 abhinav Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -58,7 +58,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.88 2016/07/14 18:16:51 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.89 2017/04/27 16:52:22 abhinav Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -868,21 +868,19 @@ kevent1(register_t *retval, int fd, kevp->flags &= ~EV_SYSFLAGS; /* register each knote */ error = kqueue_register(kq, kevp); - if (error || (kevp->flags & EV_RECEIPT)) { - if (nevents != 0) { - kevp->flags = EV_ERROR; - kevp->data = error; - error = (*keops->keo_put_events) - (keops->keo_private, kevp, - eventlist, nerrors, 1); - if (error) - goto done; - nevents--; - nerrors++; - } else { - goto done; - } - } + if (!error && !(kevp->flags & EV_RECEIPT)) + continue; + if (nevents == 0) + goto done; + kevp->flags = EV_ERROR; + kevp->data = error; + error = (*keops->keo_put_events) + (keops->keo_private, kevp, + eventlist, nerrors, 1); + if (error) + goto done; + nevents--; + nerrors++; } nchanges -= n; /* update the results */ ichange += n;