summaryrefslogtreecommitdiff
path: root/src/login
diff options
context:
space:
mode:
authorAlexander Kuleshov <kuleshovmail@gmail.com>2016-02-20 00:25:13 +0600
committerAlexander Kuleshov <kuleshovmail@gmail.com>2016-02-26 01:13:23 +0600
commitea4b98e6577ad4311e4eb4d2384c82f0d870b5ba (patch)
tree74820b01e48c222774c3884adc1ae73d39acb49e /src/login
parent16fe5e8b1d5b073c5731b170c34bddd52ccbc4ec (diff)
tree-wide: merge pager_open_if_enabled() to the pager_open()
Many subsystems define own pager_open_if_enabled() function which checks '--no-pager' command line argument and open pager depends on its value. All implementations of pager_open_if_enabled() are the same. Let's merger this function with pager_open() from the shared/pager.c and remove pager_open_if_enabled() from all subsytems to prevent code duplication.
Diffstat (limited to 'src/login')
-rw-r--r--src/login/loginctl.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/login/loginctl.c b/src/login/loginctl.c
index 6ad3d089bd..c9a5cd796b 100644
--- a/src/login/loginctl.c
+++ b/src/login/loginctl.c
@@ -59,14 +59,6 @@ static bool arg_ask_password = true;
static unsigned arg_lines = 10;
static OutputMode arg_output = OUTPUT_SHORT;
-static void pager_open_if_enabled(void) {
-
- if (arg_no_pager)
- return;
-
- pager_open(false);
-}
-
static void polkit_agent_open_if_enabled(void) {
/* Open the polkit agent as a child process if necessary */
@@ -101,7 +93,7 @@ static int list_sessions(int argc, char *argv[], void *userdata) {
assert(bus);
assert(argv);
- pager_open_if_enabled();
+ pager_open(arg_no_pager, false);
r = sd_bus_call_method(
bus,
@@ -148,7 +140,7 @@ static int list_users(int argc, char *argv[], void *userdata) {
assert(bus);
assert(argv);
- pager_open_if_enabled();
+ pager_open(arg_no_pager, false);
r = sd_bus_call_method(
bus,
@@ -194,7 +186,7 @@ static int list_seats(int argc, char *argv[], void *userdata) {
assert(bus);
assert(argv);
- pager_open_if_enabled();
+ pager_open(arg_no_pager, false);
r = sd_bus_call_method(
bus,
@@ -858,7 +850,7 @@ static int show_session(int argc, char *argv[], void *userdata) {
properties = !strstr(argv[0], "status");
- pager_open_if_enabled();
+ pager_open(arg_no_pager, false);
if (argc <= 1) {
/* If not argument is specified inspect the manager
@@ -914,7 +906,7 @@ static int show_user(int argc, char *argv[], void *userdata) {
properties = !strstr(argv[0], "status");
- pager_open_if_enabled();
+ pager_open(arg_no_pager, false);
if (argc <= 1) {
/* If not argument is specified inspect the manager
@@ -974,7 +966,7 @@ static int show_seat(int argc, char *argv[], void *userdata) {
properties = !strstr(argv[0], "status");
- pager_open_if_enabled();
+ pager_open(arg_no_pager, false);
if (argc <= 1) {
/* If not argument is specified inspect the manager