about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-07-24 16:55:12 -0400
committerJune McEnroe <june@causal.agency>2018-07-24 16:55:12 -0400
commit1a438e4130c309989e279c554f3f2abd94ab7518 (patch)
tree2b4508ffdf680f84d8169051de88797774bb419c
parentLink with -lcurses (diff)
downloadtorus-1a438e4130c309989e279c554f3f2abd94ab7518.tar.gz
torus-1a438e4130c309989e279c554f3f2abd94ab7518.zip
Use EV_SET
NetBSD kevent.udata is uintptr_t rather than void * and the macro does
the cast.
Diffstat (limited to '')
-rw-r--r--server.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/server.c b/server.c
index 9d0af0e..b2b651b 100644
--- a/server.c
+++ b/server.c
@@ -338,11 +338,8 @@ int main() {
 	int kq = kqueue();
 	if (kq < 0) err(EX_OSERR, "kqueue");
 
-	struct kevent event = {
-		.ident = server,
-		.filter = EVFILT_READ,
-		.flags = EV_ADD,
-	};
+	struct kevent event;
+	EV_SET(&event, server, EVFILT_READ, EV_ADD, 0, 0, 0);
 	int nevents = kevent(kq, &event, 1, NULL, 0, NULL);
 	if (nevents < 0) err(EX_OSERR, "kevent");
 
@@ -361,12 +358,7 @@ int main() {
 
 			struct Client *client = clientAdd(fd);
 
-			struct kevent event = {
-				.ident = fd,
-				.filter = EVFILT_READ,
-				.flags = EV_ADD,
-				.udata = client,
-			};
+			EV_SET(&event, fd, EVFILT_READ, EV_ADD, 0, 0, client);
 			nevents = kevent(kq, &event, 1, NULL, 0, NULL);
 			if (nevents < 0) err(EX_IOERR, "kevent");
 
@@ -375,7 +367,7 @@ int main() {
 			continue;
 		}
 
-		struct Client *client = event.udata;
+		struct Client *client = (struct Client *)event.udata;
 		if (event.flags & EV_EOF) {
 			clientRemove(client);
 			continue;
lass='nohover-highlight'> 2019-05-30Add bit to bin.7June McEnroe 2019-05-30Simplify and build bitJune McEnroe lex is a waste of time. 2019-05-29Add xx -p optionJune McEnroe 2019-05-27Add FrontierJune McEnroe 2019-05-27Break nicks with ZWNJJune McEnroe This should prevent bad wrapping. 2019-05-26Add DawnJune McEnroe 2019-05-20Declare vasprintf(3) for GNUJune McEnroe who the fuck is scraeming "#define _GNU_SOURCE" at my house. show yourself, coward. i will never #define _GNU_SOURCE 2019-05-20Fix comparison warning in ttpreJune McEnroe 2019-05-20Add AuthorityJune McEnroe 2019-05-19Specify precedence of unary versions of operatorsJune McEnroe 2019-05-18Add compound assignment operators to orderJune McEnroe 2019-05-15Support simple assignment in orderJune McEnroe 2019-05-15Implement sizeof in orderJune McEnroe 2019-05-15Add orderJune McEnroe 2019-05-12Add T suffix in bitJune McEnroe 2019-05-10Highlight yacc and lex files as CJune McEnroe Their %-prefixed directives should probably be highlighted Macro. 2019-05-10Use val instead of suboptargJune McEnroe suboptarg doesn't exist in GNU. Hopefully BSD getsubopt also sets val on failure? 2019-05-09Add Parable of the SowerJune McEnroe 2019-05-07Add bit without buildJune McEnroe Need to do some stuff in the Makefile for lex and yacc and generating HTML pages for it. 2019-05-04Fix MANDIR typoJune McEnroe 2019-05-04Move relay to binJune McEnroe