X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Fdbus-loop.c;h=c5332422202955fb9c45d20d9bd7d7a5c9b79d3b;hb=7fd1b19bc9e9f5574f2877936b8ac267c7706947;hp=b42ae14511764222d03cee871d4f7226b8a90545;hpb=b92bea5d2a9481de69bb627a7b442a9f58fca43d;p=elogind.git diff --git a/src/shared/dbus-loop.c b/src/shared/dbus-loop.c index b42ae1451..c53324222 100644 --- a/src/shared/dbus-loop.c +++ b/src/shared/dbus-loop.c @@ -44,8 +44,8 @@ typedef struct EpollData { } EpollData; static dbus_bool_t add_watch(DBusWatch *watch, void *data) { - EpollData _cleanup_free_ *e = NULL; - struct epoll_event ev = { .data.ptr = e }; + _cleanup_free_ EpollData *e = NULL; + struct epoll_event ev = {}; assert(watch); @@ -58,6 +58,7 @@ static dbus_bool_t add_watch(DBusWatch *watch, void *data) { e->is_timeout = false; ev.events = bus_flags_to_events(watch); + ev.data.ptr = e; if (epoll_ctl(PTR_TO_INT(data), EPOLL_CTL_ADD, e->fd, &ev) < 0) { @@ -88,7 +89,7 @@ static dbus_bool_t add_watch(DBusWatch *watch, void *data) { } static void remove_watch(DBusWatch *watch, void *data) { - EpollData _cleanup_free_ *e = NULL; + _cleanup_free_ EpollData *e = NULL; assert(watch); @@ -174,7 +175,7 @@ fail: } static void remove_timeout(DBusTimeout *timeout, void *data) { - EpollData _cleanup_free_ *e = NULL; + _cleanup_free_ EpollData *e = NULL; assert(timeout);