diff options
author | Karol Lewandowski <k.lewandowsk@samsung.com> | 2022-08-06 22:29:40 +0200 |
---|---|---|
committer | Karol Lewandowski <k.lewandowsk@samsung.com> | 2022-08-06 22:29:40 +0200 |
commit | 1c7c1bf1c12944de49a9c8430a8f21e42d006423 (patch) | |
tree | 8726c4ac19e696141269dd0b13d1118338173988 | |
parent | 336405c9f90ba1f919410ab6819a09efdad31e83 (diff) | |
download | sessiond-1c7c1bf1c12944de49a9c8430a8f21e42d006423.tar.gz sessiond-1c7c1bf1c12944de49a9c8430a8f21e42d006423.tar.bz2 sessiond-1c7c1bf1c12944de49a9c8430a8f21e42d006423.zip |
library: Simplify subsession_event_wait_done() error path
Change-Id: Ic701196aa0501a5adb3a1c8742609f82ded69909
-rw-r--r-- | libsessiond/src/lib.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/libsessiond/src/lib.c b/libsessiond/src/lib.c index 08894ae..b0027b9 100644 --- a/libsessiond/src/lib.c +++ b/libsessiond/src/lib.c @@ -804,10 +804,12 @@ static int subsession_switch_wait_done(int session_uid, uint64_t switch_id) { return_with_log_error_result_(method_call_sync_simple(dbus_method_call.SwitchUserDone, params)); } -EXPORT_API int subsession_event_wait_done(subsession_event_info info) { +EXPORT_API int subsession_event_wait_done(subsession_event_info info) +{ return_if( session_uid_is_not_valid(info.session_uid) ) + switch (info.event) { case SUBSESSION_ADD_USER_WAIT: return_if( @@ -829,13 +831,9 @@ EXPORT_API int subsession_event_wait_done(subsession_event_info info) { ) return subsession_switch_wait_done(info.session_uid, info.switch_user.switch_id); break; - - default: - { - ret_if_err_( SUBSESSION_ERROR_INVALID_PARAMETER) - } } - return_with_log_error_result_( SUBSESSION_ERROR_INVALID_PARAMETER) + + return SUBSESSION_ERROR_INVALID_PARAMETER; } EXPORT_API int subsession_get_user_list(int session_uid, subsession_user_t **user_list, int *user_count) |