summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/machine/machinectl.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c
index 7b9be3b425..9c754b4327 100644
--- a/src/machine/machinectl.c
+++ b/src/machine/machinectl.c
@@ -330,10 +330,12 @@ static int list_machines(int argc, char *argv[], void *userdata) {
printf("-\n");
}
- if (arg_legend && n_machines > 0)
- printf("\n%zu machines listed.\n", n_machines);
- else
- printf("No machines.\n");
+ if (arg_legend) {
+ if (n_machines > 0)
+ printf("\n%zu machines listed.\n", n_machines);
+ else
+ printf("No machines.\n");
+ }
out:
clean_machine_info(machines, n_machines);
@@ -463,10 +465,12 @@ static int list_images(int argc, char *argv[], void *userdata) {
(int) max_mtime, strna(format_timestamp(mtime_buf, sizeof(mtime_buf), images[j].mtime)));
}
- if (arg_legend && n_images > 0)
- printf("\n%zu images listed.\n", n_images);
- else
- printf("No images.\n");
+ if (arg_legend) {
+ if (n_images > 0)
+ printf("\n%zu images listed.\n", n_images);
+ else
+ printf("No images.\n");
+ }
return 0;
}
@@ -2489,10 +2493,12 @@ static int list_transfers(int argc, char *argv[], void *userdata) {
(int) max_local, transfers[j].local,
(int) max_remote, transfers[j].remote);
- if (arg_legend && n_transfers > 0)
- printf("\n%zu transfers listed.\n", n_transfers);
- else
- printf("No transfers.\n");
+ if (arg_legend) {
+ if (n_transfers > 0)
+ printf("\n%zu transfers listed.\n", n_transfers);
+ else
+ printf("No transfers.\n");
+ }
return 0;
}