diff options
author | Karel Zak | 2017-09-15 12:28:44 +0200 |
---|---|---|
committer | Karel Zak | 2017-09-15 12:28:44 +0200 |
commit | e8f6060f27990881390c8ff4aa4c3aeae00da7b6 (patch) | |
tree | 72966464027c89752ee77b69779cf32e0e1cfd06 /sys-utils/rfkill.c | |
parent | rfkill: do not fsync(3) /dev/rfkill file descriptor (diff) | |
download | kernel-qcow2-util-linux-e8f6060f27990881390c8ff4aa4c3aeae00da7b6.tar.gz kernel-qcow2-util-linux-e8f6060f27990881390c8ff4aa4c3aeae00da7b6.tar.xz kernel-qcow2-util-linux-e8f6060f27990881390c8ff4aa4c3aeae00da7b6.zip |
rfkill: fix coding style and error messages
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/rfkill.c')
-rw-r--r-- | sys-utils/rfkill.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sys-utils/rfkill.c b/sys-utils/rfkill.c index 7914c4309..1379b6b6f 100644 --- a/sys-utils/rfkill.c +++ b/sys-utils/rfkill.c @@ -311,7 +311,10 @@ static void fill_table_row(struct libscols_table *tb, struct rfkill_event *event static void rfkill_list_init(struct control *ctrl) { + size_t i; + scols_init_debug(0); + ctrl->tb = scols_new_table(); if (!ctrl->tb) err(EXIT_FAILURE, _("failed to allocate output table")); @@ -319,15 +322,12 @@ static void rfkill_list_init(struct control *ctrl) scols_table_enable_json(ctrl->tb, ctrl->json); scols_table_enable_noheadings(ctrl->tb, ctrl->no_headings); scols_table_enable_raw(ctrl->tb, ctrl->raw); - { - size_t i; - for (i = 0; i < (size_t)ncolumns; i++) { - const struct colinfo *col = get_column_info(i); + for (i = 0; i < (size_t) ncolumns; i++) { + const struct colinfo *col = get_column_info(i); - if (!scols_table_new_column(ctrl->tb, col->name, col->whint, col->flags)) - err(EXIT_FAILURE, _("failed to initialize output column")); - } + if (!scols_table_new_column(ctrl->tb, col->name, col->whint, col->flags)) + err(EXIT_FAILURE, _("failed to allocate output column")); } } |