chiark / gitweb /
loginctl: improve print_{session|user|seat}_status_info() functions
authorDjalal Harouni <tixxdz@opendz.org>
Tue, 17 Dec 2013 18:42:03 +0000 (19:42 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 19 Dec 2013 04:58:24 +0000 (23:58 -0500)
commit495cb9bbeb0bf2959f12e69253465a6aa03e7aef
tree4aaf43271ee38295ee3c9ccaecf1d910dbf35a99
parent97aa7b478177f200d250dc0186f49e52b5f6e3c8
loginctl: improve print_{session|user|seat}_status_info() functions

1) Instead of checking if we need to print a new line on each iteration,
pass the "new_line" as a pointer to those functions, so they can use
it to check if a new line is needed. This makes the code more consistent
as it is done in other places: machinectl, systemctl...

2) Move the error messages from show_{session|user|seat}() to their
appropriate print_{session|user|seat}_status_info() functions, this will
prevent from logging an error message twice in case show_properties()
fails and it will improve code readability.

3) Also do not ignore error codes on these functions.
src/login/loginctl.c