Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

backend/session: allow wlr_session_find_gpus to return an error #2578

Merged
merged 1 commit into from
Jan 4, 2021

Conversation

emersion
Copy link
Member

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.


Breaking change: wlr_session_find_gpus now returns a ssize_t instead of a size_t.

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.
@emersion emersion added the breaking Breaking change in public API label Dec 28, 2020
@emersion emersion merged commit e8d56ca into swaywm:master Jan 4, 2021
@emersion emersion deleted the find-gpus-error branch January 4, 2021 18:46
@emersion emersion mentioned this pull request Mar 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking Breaking change in public API
Development

Successfully merging this pull request may close these issues.

None yet

1 participant