File tree Expand file tree Collapse file tree 1 file changed +15
-10
lines changed
Expand file tree Collapse file tree 1 file changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -337,16 +337,21 @@ pub fn logout() -> ShutdownResult {
337337 } // show_dialog - true, allow_save - true
338338
339339 let session_id = get_session_id ( ) ;
340- if !session_id. is_empty ( ) {
341- if dbus_send (
342- "org.freedesktop.login1" ,
343- "/org/freedesktop/login1" ,
344- "org.freedesktop.login1.Manager" ,
345- "TerminateSession" ,
346- & ( session_id) ,
347- ) {
348- return Ok ( ( ) ) ;
349- }
340+ if session_id. is_empty ( ) {
341+ return Err ( Error :: new (
342+ ErrorKind :: Other ,
343+ "could not determine session ID for logout" ,
344+ ) ) ;
345+ }
346+
347+ if dbus_send (
348+ "org.freedesktop.login1" ,
349+ "/org/freedesktop/login1" ,
350+ "org.freedesktop.login1.Manager" ,
351+ "TerminateSession" ,
352+ & session_id,
353+ ) {
354+ return Ok ( ( ) ) ;
350355 }
351356
352357 // As a last resort
You can’t perform that action at this time.
0 commit comments