From 7e38c11b87d6056236d8bdf43ecfea9efa4c740b Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Sun, 30 Oct 2016 11:20:36 +0100 Subject: [PATCH] Signal handlers require signo to be public Signed-off-by: Joachim Nilsson --- private.h | 5 ----- signal.c | 4 ++-- uev.h | 1 + 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/private.h b/private.h index e4d7b8c..bfc3e42 100644 --- a/private.h +++ b/private.h @@ -68,11 +68,6 @@ struct uev; int timeout; \ int period; \ } t; \ - \ - /* Signal watchers */ \ - struct { \ - int signo; \ - } s; \ } u; \ \ /* Watcher type */ \ diff --git a/signal.c b/signal.c index 8612d92..6e32797 100644 --- a/signal.c +++ b/signal.c @@ -87,7 +87,7 @@ int uev_signal_set(uev_t *w, int signo) } /* Remember for callbacks and start/stop */ - w->u.s.signo = signo; + w->signo = signo; /* Handle stopped signal watchers */ if (w->fd < 0) { @@ -129,7 +129,7 @@ int uev_signal_start(uev_t *w) if (-1 != w->fd) uev_signal_stop(w); - return uev_signal_set(w, w->u.s.signo); + return uev_signal_set(w, w->signo); } /** diff --git a/uev.h b/uev.h index e3879c4..8b79efa 100644 --- a/uev.h +++ b/uev.h @@ -46,6 +46,7 @@ typedef struct uev { uev_private_t type; /* Public data for users to reference */ + int signo; int fd; uev_ctx_t *ctx; } uev_t;