Change-Id: Idb427c13f0a973dd933831350003e7129d5bf8c5
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
}
else if (a == 0)
{
- ERR("Received an invalid file descriptor");
+ ERR("Received an invalid socket");
goto sock_err;
}
+ /* If unset wl_display_add_socket_auto() would fail, let's fail too. */
runtime_dir = getenv("XDG_RUNTIME_DIR");
if (!runtime_dir)
{
goto sock_err;
}
- wl_display_add_socket_fd(cdata->wl.disp, f);
+ if (wl_display_add_socket_fd(cdata->wl.disp, f) < 0)
+ {
+ ERR("Could not add a file descriptor to a display");
+ goto sock_err;
+ }
}
else
#endif