Compare commits
2 Commits
c315b79fb4
...
ad5555b42e
Author | SHA1 | Date |
---|---|---|
Alin Popa | ad5555b42e | |
Alin Popa | bec31cf5f0 |
|
@ -1458,11 +1458,11 @@ static int assess(const struct security_info *info, Table *overview_table, Analy
|
|||
if (!details_table)
|
||||
return log_oom();
|
||||
|
||||
(void) table_set_sort(details_table, 3, 1, (size_t) -1);
|
||||
(void) table_set_sort(details_table, (size_t) 3, (size_t) 1, (size_t) -1);
|
||||
(void) table_set_reverse(details_table, 3, true);
|
||||
|
||||
if (getenv_bool("SYSTEMD_ANALYZE_DEBUG") <= 0)
|
||||
(void) table_set_display(details_table, 0, 1, 2, 6, (size_t) -1);
|
||||
(void) table_set_display(details_table, (size_t) 0, (size_t) 1, (size_t) 2, (size_t) 6, (size_t) -1);
|
||||
}
|
||||
|
||||
for (i = 0; i < ELEMENTSOF(security_assessor_table); i++) {
|
||||
|
|
|
@ -1101,7 +1101,7 @@ static int analyze_blame(int argc, char *argv[], void *userdata) {
|
|||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = table_set_sort(table, 0, SIZE_MAX);
|
||||
r = table_set_sort(table, (size_t) 0, (size_t) SIZE_MAX);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
|
|
@ -207,14 +207,32 @@ static int list_bus_names(int argc, char **argv, void *userdata) {
|
|||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to set empty string: %m");
|
||||
|
||||
r = table_set_sort(table, COLUMN_NAME, (size_t) -1);
|
||||
r = table_set_sort(table, (size_t) COLUMN_NAME, (size_t) -1);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to set sort column: %m");
|
||||
|
||||
if (arg_show_machine)
|
||||
r = table_set_display(table, COLUMN_NAME, COLUMN_PID, COLUMN_PROCESS, COLUMN_USER, COLUMN_CONNECTION, COLUMN_UNIT, COLUMN_SESSION, COLUMN_DESCRIPTION, COLUMN_MACHINE, (size_t) -1);
|
||||
r = table_set_display(table, (size_t) COLUMN_NAME,
|
||||
(size_t) COLUMN_PID,
|
||||
(size_t) COLUMN_PROCESS,
|
||||
(size_t) COLUMN_USER,
|
||||
(size_t) COLUMN_CONNECTION,
|
||||
(size_t) COLUMN_UNIT,
|
||||
(size_t) COLUMN_SESSION,
|
||||
(size_t) COLUMN_DESCRIPTION,
|
||||
(size_t) COLUMN_MACHINE,
|
||||
(size_t) -1);
|
||||
else
|
||||
r = table_set_display(table, COLUMN_NAME, COLUMN_PID, COLUMN_PROCESS, COLUMN_USER, COLUMN_CONNECTION, COLUMN_UNIT, COLUMN_SESSION, COLUMN_DESCRIPTION, (size_t) -1);
|
||||
r = table_set_display(table, (size_t) COLUMN_NAME,
|
||||
(size_t) COLUMN_PID,
|
||||
(size_t) COLUMN_PROCESS,
|
||||
(size_t) COLUMN_USER,
|
||||
(size_t) COLUMN_CONNECTION,
|
||||
(size_t) COLUMN_UNIT,
|
||||
(size_t) COLUMN_SESSION,
|
||||
(size_t) COLUMN_DESCRIPTION,
|
||||
(size_t) -1);
|
||||
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to set columns to display: %m");
|
||||
|
||||
|
|
|
@ -1403,7 +1403,7 @@ static int list_devices(void) {
|
|||
if (arg_full)
|
||||
table_set_width(table, 0);
|
||||
|
||||
r = table_set_sort(table, 0, SIZE_MAX);
|
||||
r = table_set_sort(table, (size_t) 0, (size_t) SIZE_MAX);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to set sort index: %m");
|
||||
|
||||
|
|
|
@ -879,7 +879,7 @@ static int dump_address_labels(sd_netlink *rtnl) {
|
|||
if (arg_full)
|
||||
table_set_width(table, 0);
|
||||
|
||||
r = table_set_sort(table, 0, SIZE_MAX);
|
||||
r = table_set_sort(table, (size_t) 0, (size_t) SIZE_MAX);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
|
|
@ -1555,7 +1555,7 @@ static int context_dump_partitions(Context *context, const char *node) {
|
|||
return log_oom();
|
||||
|
||||
if (!DEBUG_LOGGING)
|
||||
(void) table_set_display(t, 0, 1, 2, 3, 4, 7, 9, (size_t) -1);
|
||||
(void) table_set_display(t, (size_t) 0, (size_t) 1, (size_t) 2, (size_t) 3, (size_t) 4, (size_t) 7, (size_t) 9, (size_t) -1);
|
||||
|
||||
(void) table_set_align_percent(t, table_get_cell(t, 0, 4), 100);
|
||||
(void) table_set_align_percent(t, table_get_cell(t, 0, 5), 100);
|
||||
|
|
|
@ -991,7 +991,7 @@ static int output_sockets_list(struct socket_info *socket_infos, unsigned cs) {
|
|||
|
||||
if (!arg_show_types) {
|
||||
/* Hide the second (TYPE) column */
|
||||
r = table_set_display(table, 0, 2, 3, (size_t) -1);
|
||||
r = table_set_display(table, (size_t) 0, (size_t) 2, (size_t) 3, (size_t) -1);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to set columns to display: %m");
|
||||
}
|
||||
|
|
|
@ -112,8 +112,8 @@ static int display_user(int argc, char *argv[], void *userdata) {
|
|||
(void) table_set_align_percent(table, table_get_cell(table, 0, 2), 100);
|
||||
(void) table_set_align_percent(table, table_get_cell(table, 0, 3), 100);
|
||||
(void) table_set_empty_string(table, "-");
|
||||
(void) table_set_sort(table, 7, 2, (size_t) -1);
|
||||
(void) table_set_display(table, 0, 1, 2, 3, 4, 5, 6, (size_t) -1);
|
||||
(void) table_set_sort(table, (size_t) 7, (size_t) 2, (size_t) -1);
|
||||
(void) table_set_display(table, (size_t) 0, (size_t) 1, (size_t) 2, (size_t) 3, (size_t) 4, (size_t) 5, (size_t) 6, (size_t) -1);
|
||||
}
|
||||
|
||||
if (argc > 1) {
|
||||
|
@ -260,8 +260,8 @@ static int display_group(int argc, char *argv[], void *userdata) {
|
|||
return log_oom();
|
||||
|
||||
(void) table_set_align_percent(table, table_get_cell(table, 0, 2), 100);
|
||||
(void) table_set_sort(table, 3, 2, (size_t) -1);
|
||||
(void) table_set_display(table, 0, 1, 2, (size_t) -1);
|
||||
(void) table_set_sort(table, (size_t) 3, (size_t) 2, (size_t) -1);
|
||||
(void) table_set_display(table, (size_t) 0, (size_t) 1, (size_t) 2, (size_t) -1);
|
||||
}
|
||||
|
||||
if (argc > 1) {
|
||||
|
@ -400,7 +400,7 @@ static int display_memberships(int argc, char *argv[], void *userdata) {
|
|||
if (!table)
|
||||
return log_oom();
|
||||
|
||||
(void) table_set_sort(table, 0, 1, (size_t) -1);
|
||||
(void) table_set_sort(table, (size_t) 0, (size_t) 1, (size_t) -1);
|
||||
}
|
||||
|
||||
if (argc > 1) {
|
||||
|
@ -489,7 +489,7 @@ static int display_services(int argc, char *argv[], void *userdata) {
|
|||
if (!t)
|
||||
return log_oom();
|
||||
|
||||
(void) table_set_sort(t, 0, (size_t) -1);
|
||||
(void) table_set_sort(t, (size_t) 0, (size_t) -1);
|
||||
|
||||
FOREACH_DIRENT(de, d, return -errno) {
|
||||
_cleanup_free_ char *j = NULL, *no = NULL;
|
||||
|
|
Loading…
Reference in New Issue