Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern Rearrange the if conditions in order to get rid of ...
details: https://anonhg.NetBSD.org/src/rev/8dacf791b7d0
branches: trunk
changeset: 353291:8dacf791b7d0
user: abhinav <abhinav%NetBSD.org@localhost>
date: Thu Apr 27 16:52:22 2017 +0000
description:
Rearrange the if conditions in order to get rid of unnecessary indentation.
No functional change intended. ok christos@
diffstat:
sys/kern/kern_event.c | 32 +++++++++++++++-----------------
1 files changed, 15 insertions(+), 17 deletions(-)
diffs (53 lines):
diff -r 72cd972e77f3 -r 8dacf791b7d0 sys/kern/kern_event.c
--- a/sys/kern/kern_event.c Thu Apr 27 11:02:14 2017 +0000
+++ b/sys/kern/kern_event.c Thu Apr 27 16:52:22 2017 +0000
@@ -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 @@
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;
Home |
Main Index |
Thread Index |
Old Index