From: Karel Zak Date: Thu, 2 Nov 2023 12:22:00 +0000 (+0100) Subject: lsfd: use SCOLS_JSON_FLOAT X-Git-Tag: v2.40-rc1~151^2~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bdc89612c27a63395e9573457bcdca1fe741f327;p=thirdparty%2Futil-linux.git lsfd: use SCOLS_JSON_FLOAT * use a new SCOLS_JSON_FLOAT * add "float" to the columns description * add space before '?' operator Reported-by: Masatake YAMATO Addresses: https://github.com/util-linux/util-linux/pull/2531#issuecomment-1780164195 Signed-off-by: Karel Zak --- diff --git a/misc-utils/lsfd.c b/misc-utils/lsfd.c index d01bb7bfe8..bac2bac3ca 100644 --- a/misc-utils/lsfd.c +++ b/misc-utils/lsfd.c @@ -331,10 +331,10 @@ static const struct colinfo infos[] = { 0, SCOLS_FL_RIGHT, SCOLS_JSON_STRING, N_("clockid") }, [COL_TIMERFD_INTERVAL] = { "TIMERFD.INTERVAL", - 0, SCOLS_FL_RIGHT, SCOLS_JSON_NUMBER, + 0, SCOLS_FL_RIGHT, SCOLS_JSON_FLOAT, N_("interval") }, [COL_TIMERFD_REMAINING]= { "TIMERFD.REMAINING", - 0, SCOLS_FL_RIGHT, SCOLS_JSON_NUMBER, + 0, SCOLS_FL_RIGHT, SCOLS_JSON_FLOAT, N_("remaining time") }, [COL_TUN_IFACE] = { "TUN.IFACE", 0, SCOLS_FL_RIGHT, SCOLS_JSON_STRING, @@ -1796,10 +1796,11 @@ static void __attribute__((__noreturn__)) list_colunms(FILE *out) fputs(USAGE_COLUMNS, out); for (size_t i = 0; i < ARRAY_SIZE(infos); i++) fprintf(out, " %20s %-10s%s\n", infos[i].name, - infos[i].json_type == SCOLS_JSON_STRING? "": - infos[i].json_type == SCOLS_JSON_ARRAY_STRING? "": - infos[i].json_type == SCOLS_JSON_ARRAY_NUMBER? "": - infos[i].json_type == SCOLS_JSON_NUMBER? "": + infos[i].json_type == SCOLS_JSON_STRING ? "": + infos[i].json_type == SCOLS_JSON_ARRAY_STRING ? "": + infos[i].json_type == SCOLS_JSON_ARRAY_NUMBER ? "": + infos[i].json_type == SCOLS_JSON_NUMBER ? "": + infos[i].json_type == SCOLS_JSON_FLOAT ? "": "", _(infos[i].help)); exit(EXIT_SUCCESS);