mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-25 00:38:24 -05:00
dbus: Check eloop registration failure in add_watch handler
Report failures at lower layer to the upper layer D-Bus handling of socket registration to allow failures to be addressed more cleanly. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
parent
56a1df71e5
commit
aa06444f2c
@ -108,17 +108,18 @@ static dbus_bool_t add_watch(DBusWatch *watch, void *data)
|
|||||||
flags = dbus_watch_get_flags(watch);
|
flags = dbus_watch_get_flags(watch);
|
||||||
fd = dbus_watch_get_unix_fd(watch);
|
fd = dbus_watch_get_unix_fd(watch);
|
||||||
|
|
||||||
eloop_register_sock(fd, EVENT_TYPE_EXCEPTION, process_watch_exception,
|
if (eloop_register_sock(fd, EVENT_TYPE_EXCEPTION,
|
||||||
priv, watch);
|
process_watch_exception, priv, watch) < 0)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
if (flags & DBUS_WATCH_READABLE) {
|
if ((flags & DBUS_WATCH_READABLE) &&
|
||||||
eloop_register_sock(fd, EVENT_TYPE_READ, process_watch_read,
|
eloop_register_sock(fd, EVENT_TYPE_READ, process_watch_read,
|
||||||
priv, watch);
|
priv, watch) < 0)
|
||||||
}
|
return FALSE;
|
||||||
if (flags & DBUS_WATCH_WRITABLE) {
|
if ((flags & DBUS_WATCH_WRITABLE) &&
|
||||||
eloop_register_sock(fd, EVENT_TYPE_WRITE, process_watch_write,
|
eloop_register_sock(fd, EVENT_TYPE_WRITE, process_watch_write,
|
||||||
priv, watch);
|
priv, watch) < 0)
|
||||||
}
|
return FALSE;
|
||||||
|
|
||||||
dbus_watch_set_data(watch, priv, NULL);
|
dbus_watch_set_data(watch, priv, NULL);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user