From 1dbf1002055627f473ac891d1ea309f1f3ddc2c3 Mon Sep 17 00:00:00 2001 From: Kenny Levinsen Date: Tue, 24 Nov 2020 13:12:31 +0100 Subject: logind: switch_session should return 0 on success It currently returned -1 on failure and 1 on success. The API is intended to return -1 on failure and 0 on success, so fix that. --- libseat/backend/logind.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libseat') diff --git a/libseat/backend/logind.c b/libseat/backend/logind.c index 76297ce..f0cadce 100644 --- a/libseat/backend/logind.c +++ b/libseat/backend/logind.c @@ -172,7 +172,7 @@ static int switch_session(struct libseat *base, int s) { sd_bus_error_free(&error); sd_bus_message_unref(msg); - return ret >= 0; + return ret < 0 ? -1 : 0; } static int disable_seat(struct libseat *base) { -- cgit v1.2.3