From 1480976724f2c3a2f5dd7cd2c9dd5c1dd2b9f152 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Sun, 19 Jul 2015 04:40:30 +0200 Subject: [PATCH] Fix data ordering bug causing problems on Debian Jessie Got very odd results on Debian Jessie when having the uev_private_t last in uev_t. Turns out that when uev.c set "w->active = 0;" the w->fd data member was written to instead. Placing the private data first in uev_t is better practise, generally a good thing for linked lists built on the BSD sys/queue.h API, looks a lot better, but foremost works. Signed-off-by: Joachim Nilsson --- uev.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/uev.h b/uev.h index 6d59c89..2eb86fb 100644 --- a/uev.h +++ b/uev.h @@ -41,10 +41,12 @@ /* Event watcher */ typedef struct uev { + /* Private data for libuEv internal engine */ + uev_private_t type; + + /* Public data for users to reference */ int fd; uev_ctx_t *ctx; - - uev_private_t type; } uev_t; /* Generic callback for watchers */