From aafd89408ca7f6bd92d3a9c1185fca8d5accb4d9 Mon Sep 17 00:00:00 2001 From: tedu Date: Wed, 31 May 2017 07:12:28 +0000 Subject: [PATCH] make a copy of the first EV_SET argument to prevent multiple evaluation. matches freebsd, fixes lldb. from Kamil Rytarowski at NetBSD. while here, make the same change to KNOTE. ok deraadt --- sys/sys/event.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/sys/event.h b/sys/sys/event.h index b238958dcfd..13b370b4c40 100644 --- a/sys/sys/event.h +++ b/sys/sys/event.h @@ -1,4 +1,4 @@ -/* $OpenBSD: event.h,v 1.23 2016/09/24 18:39:17 tedu Exp $ */ +/* $OpenBSD: event.h,v 1.24 2017/05/31 07:12:28 tedu Exp $ */ /*- * Copyright (c) 1999,2000,2001 Jonathan Lemon @@ -41,7 +41,8 @@ #define EVFILT_SYSCOUNT 7 -#define EV_SET(kevp, a, b, c, d, e, f) do { \ +#define EV_SET(kevp_, a, b, c, d, e, f) do { \ + struct kevent *kevp = (kevp_); \ (kevp)->ident = (a); \ (kevp)->filter = (b); \ (kevp)->flags = (c); \ @@ -118,7 +119,8 @@ SLIST_HEAD(klist, knote); #ifdef _KERNEL -#define KNOTE(list, hint) do { \ +#define KNOTE(list_, hint) do { \ + struct klist *list = (list_); \ if ((list) != NULL) \ knote((list), (hint)); \ } while (0) -- 2.20.1