From e8d56ca415f6214681daa65c0da505cd2d0bdc75 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 28 Dec 2020 10:52:40 +0100 Subject: backend/session: allow wlr_session_find_gpus to return an error Sometimes wlr_session_find_gpus will encounter an error. This is different from finding zero GPUs. On error, wlr_session_find_gpus already returns -1. However, this is casted to size_t, so callers uncorrectly assume this is a success. Instead, make wlr_session_find_gpus return a ssize_t and allow callers to handle the error accordingly. --- include/wlr/backend/session.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/wlr') diff --git a/include/wlr/backend/session.h b/include/wlr/backend/session.h index 06c23d73..7c0d3b22 100644 --- a/include/wlr/backend/session.h +++ b/include/wlr/backend/session.h @@ -96,7 +96,7 @@ void wlr_session_close_file(struct wlr_session *session, */ bool wlr_session_change_vt(struct wlr_session *session, unsigned vt); -size_t wlr_session_find_gpus(struct wlr_session *session, +ssize_t wlr_session_find_gpus(struct wlr_session *session, size_t ret_len, struct wlr_device **ret); #endif -- cgit v1.2.3