From: Aya Levin Date: Thu, 28 Feb 2019 12:12:56 +0000 (+0200) Subject: devlink: Fix boolean JSON print X-Git-Tag: v5.4.0~141^2~8 X-Git-Url: https://git.proxmox.com/?p=mirror_iproute2.git;a=commitdiff_plain;h=8257e6c49cca9847e01262f6e749c6e88e2ddb72 devlink: Fix boolean JSON print This patch removes the inverted commas from boolean values in JSON format: true/false instead of "true"/"false". Signed-off-by: Aya Levin Reviewed-by: Moshe Shemesh Acked-by: Jiri Pirko Signed-off-by: David Ahern --- diff --git a/devlink/devlink.c b/devlink/devlink.c index 8a28b5d5..4b7e8ec2 100644 --- a/devlink/devlink.c +++ b/devlink/devlink.c @@ -1628,10 +1628,10 @@ static void pr_out_str(struct dl *dl, const char *name, const char *val) static void pr_out_bool(struct dl *dl, const char *name, bool val) { - if (val) - pr_out_str(dl, name, "true"); + if (dl->json_output) + jsonw_bool_field(dl->jw, name, val); else - pr_out_str(dl, name, "false"); + pr_out_str(dl, name, val ? "true" : "false"); } static void pr_out_uint(struct dl *dl, const char *name, unsigned int val)