@@ -324,42 +324,50 @@ func (c *Conn) GetUserPropertyContext(ctx context.Context, userPath dbus.ObjectP
324
324
}
325
325
326
326
// LockSession asks the session with the specified ID to activate the screen lock.
327
- func (c * Conn ) LockSession (id string ) {
328
- c .object .Call (dbusManagerInterface + ".LockSession" , 0 , id )
327
+ func (c * Conn ) LockSession (id string ) error {
328
+ call := c .object .Call (dbusManagerInterface + ".LockSession" , 0 , id )
329
+ return call .Err
329
330
}
330
331
331
332
// LockSessions asks all sessions to activate the screen locks. This may be used to lock any access to the machine in one action.
332
- func (c * Conn ) LockSessions () {
333
- c .object .Call (dbusManagerInterface + ".LockSessions" , 0 )
333
+ func (c * Conn ) LockSessions () error {
334
+ call := c .object .Call (dbusManagerInterface + ".LockSessions" , 0 )
335
+ return call .Err
334
336
}
335
337
336
338
// TerminateSession forcibly terminate one specific session.
337
- func (c * Conn ) TerminateSession (id string ) {
338
- c .object .Call (dbusManagerInterface + ".TerminateSession" , 0 , id )
339
+ func (c * Conn ) TerminateSession (id string ) error {
340
+ call := c .object .Call (dbusManagerInterface + ".TerminateSession" , 0 , id )
341
+ return call .Err
339
342
}
340
343
341
344
// TerminateUser forcibly terminates all processes of a user.
342
- func (c * Conn ) TerminateUser (uid uint32 ) {
343
- c .object .Call (dbusManagerInterface + ".TerminateUser" , 0 , uid )
345
+ func (c * Conn ) TerminateUser (uid uint32 ) error {
346
+ call := c .object .Call (dbusManagerInterface + ".TerminateUser" , 0 , uid )
347
+ return call .Err
344
348
}
345
349
346
350
// Reboot asks logind for a reboot optionally asking for auth.
347
- func (c * Conn ) Reboot (askForAuth bool ) {
348
- c .object .Call (dbusManagerInterface + ".Reboot" , 0 , askForAuth )
351
+ func (c * Conn ) Reboot (askForAuth bool ) error {
352
+ call := c .object .Call (dbusManagerInterface + ".Reboot" , 0 , askForAuth )
353
+ return call .Err
349
354
}
350
355
351
356
// RebootWithFlags asks logind for a reboot with flags.
352
- func (c * Conn ) RebootWithFlags (flags uint64 ) {
353
- c .object .Call (dbusManagerInterface + ".RebootWithFlags" , 0 , flags )
357
+ func (c * Conn ) RebootWithFlags (flags uint64 ) error {
358
+ call := c .object .Call (dbusManagerInterface + ".RebootWithFlags" , 0 , flags )
359
+ return call .Err
354
360
}
355
361
356
362
// ScheduleShutdown asks logind to schedule a shutdown.
357
- func (c * Conn ) ScheduleShutdown (typ ScheduleShutdownType , when time.Time ) {
358
- c .object .Call (dbusManagerInterface + ".ScheduleShutdown" , 0 , typ .String (), when .UTC ().UnixMicro ())
363
+ func (c * Conn ) ScheduleShutdown (typ ScheduleShutdownType , when time.Time ) error {
364
+ call := c .object .Call (dbusManagerInterface + ".ScheduleShutdown" , 0 , typ .String (), when .UTC ().UnixMicro ())
365
+ return call .Err
359
366
}
360
367
361
- func (c * Conn ) SetWallMessage (message string , enable bool ) {
362
- c .object .Call (dbusManagerInterface + ".SetWallMessage" , 0 , message , enable )
368
+ func (c * Conn ) SetWallMessage (message string , enable bool ) error {
369
+ call := c .object .Call (dbusManagerInterface + ".SetWallMessage" , 0 , message , enable )
370
+ return call .Err
363
371
}
364
372
365
373
// Inhibit takes inhibition lock in logind.
0 commit comments