mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-24 16:28:23 -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);
|
||||
fd = dbus_watch_get_unix_fd(watch);
|
||||
|
||||
eloop_register_sock(fd, EVENT_TYPE_EXCEPTION, process_watch_exception,
|
||||
priv, watch);
|
||||
if (eloop_register_sock(fd, EVENT_TYPE_EXCEPTION,
|
||||
process_watch_exception, priv, watch) < 0)
|
||||
return FALSE;
|
||||
|
||||
if (flags & DBUS_WATCH_READABLE) {
|
||||
eloop_register_sock(fd, EVENT_TYPE_READ, process_watch_read,
|
||||
priv, watch);
|
||||
}
|
||||
if (flags & DBUS_WATCH_WRITABLE) {
|
||||
eloop_register_sock(fd, EVENT_TYPE_WRITE, process_watch_write,
|
||||
priv, watch);
|
||||
}
|
||||
if ((flags & DBUS_WATCH_READABLE) &&
|
||||
eloop_register_sock(fd, EVENT_TYPE_READ, process_watch_read,
|
||||
priv, watch) < 0)
|
||||
return FALSE;
|
||||
if ((flags & DBUS_WATCH_WRITABLE) &&
|
||||
eloop_register_sock(fd, EVENT_TYPE_WRITE, process_watch_write,
|
||||
priv, watch) < 0)
|
||||
return FALSE;
|
||||
|
||||
dbus_watch_set_data(watch, priv, NULL);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user