diff options
author | dlg <dlg@openbsd.org> | 2008-11-05 09:07:56 +0000 |
---|---|---|
committer | dlg <dlg@openbsd.org> | 2008-11-05 09:07:56 +0000 |
commit | 8b068fc7eb370d7fd057363db282ead81b3200e3 (patch) | |
tree | f2d9073f1fbf1849f97e089bc13a3e4ff76090bc /sys/sys/event.h | |
parent | since mmclose() is only called once for the final close, (diff) | |
download | wireguard-openbsd-8b068fc7eb370d7fd057363db282ead81b3200e3.tar.xz wireguard-openbsd-8b068fc7eb370d7fd057363db282ead81b3200e3.zip |
wrap an if statement in a macro up with do { } while (0) so it is safe to
use in other if/else blocks.
"yeah" deraadt@
Diffstat (limited to 'sys/sys/event.h')
-rw-r--r-- | sys/sys/event.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/sys/event.h b/sys/sys/event.h index d6b9596f29d..38f0e89e5f8 100644 --- a/sys/sys/event.h +++ b/sys/sys/event.h @@ -1,4 +1,4 @@ -/* $OpenBSD: event.h,v 1.11 2007/05/30 00:23:48 tedu Exp $ */ +/* $OpenBSD: event.h,v 1.12 2008/11/05 09:07:56 dlg Exp $ */ /*- * Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon@FreeBSD.org> @@ -118,7 +118,10 @@ SLIST_HEAD(klist, knote); #ifdef _KERNEL -#define KNOTE(list, hint) if ((list) != NULL) knote(list, hint) +#define KNOTE(list, hint) do { \ + if ((list) != NULL) \ + knote(list, hint); \ + } while (0) /* * Flag indicating hint is a signal. Used by EVFILT_SIGNAL, and also |