mirror_iproute2/lib
Serhey Popovych 5433656705 ip: Use single variable to represent -pretty
After commit a233caa0aa ("json: make pretty printing optional") I get
following build failure:

    LINK     rtmon
    ../lib/libutil.a(json_print.o): In function `new_json_obj':
    json_print.c:(.text+0x35): undefined reference to `show_pretty'
    collect2: error: ld returned 1 exit status
    make[1]: *** [rtmon] Error 1
    make: *** [all] Error 2

It is caused by missing show_pretty variable in rtmon.

On the other hand tc/tc.c there are two distinct variables and single
matches() call that handles -pretty option thus setting show_pretty
will never happen. Note that since commit 44dcfe8201 ("Change
formatting of u32 back to default") show_pretty is used in tc/f_u32.c
so this is first place where -pretty introduced.

Furthermore other utilities like misc/ifstat.c and misc/nstat.c define
pretty variable, however only for their own purposes. They both support
JSON output and thus depend show_pretty in new_json_obj().

Assuming above use common variable to represent -pretty option, define
it in utils.c and declare in utils.h that is commonly used. Replace
show_pretty with pretty.

Fixes: a233caa0aa ("json: make pretty printing optional")
Signed-off-by: Serhey Popovych <serhe.popovych@gmail.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
2018-02-16 08:13:36 -08:00
..
bpf.c bpf: support map offload 2018-01-19 12:35:41 -08:00
color.c SPDX license identifiers 2017-11-24 12:21:35 -08:00
coverity_model.c scrub out whitespace issues 2016-03-27 10:50:14 -07:00
dnet_ntop.c SPDX license identifiers 2017-11-24 12:21:35 -08:00
dnet_pton.c SPDX license identifiers 2017-11-24 12:21:35 -08:00
exec.c SPDX license identifiers 2017-11-24 12:21:35 -08:00
fs.c Convert the obvious cases to strlcpy() 2017-09-01 12:10:54 -07:00
inet_proto.c drop unneeded include of syslog.h 2017-11-12 16:22:36 -08:00
ipx_ntop.c SPDX license identifiers 2017-11-24 12:21:35 -08:00
ipx_pton.c SPDX license identifiers 2017-11-24 12:21:35 -08:00
json_print.c ip: Use single variable to represent -pretty 2018-02-16 08:13:36 -08:00
json_writer.c json: fix newline at end of array 2018-02-10 08:18:49 -08:00
libgenl.c SPDX license identifiers 2017-11-24 12:21:35 -08:00
libnetlink.c lib/libnetlink: Add a new function rtnl_talk_iov 2018-01-14 09:03:33 -08:00
ll_addr.c utils: ll_addr: Handle ARPHRD_IP6GRE in ll_addr_n2a() 2017-12-26 09:07:42 -08:00
ll_map.c drop unneeded include of syslog.h 2017-11-12 16:22:36 -08:00
ll_proto.c drop unneeded include of syslog.h 2017-11-12 16:22:36 -08:00
ll_types.c drop unneeded include of syslog.h 2017-11-12 16:22:36 -08:00
Makefile SPDX license identifiers 2017-11-24 12:21:35 -08:00
mpls_ntop.c SPDX license identifiers 2017-11-24 12:21:35 -08:00
mpls_pton.c SPDX license identifiers 2017-11-24 12:21:35 -08:00
names.c Replace malloc && memset by calloc 2016-07-20 12:05:24 -07:00
namespace.c lib/namespace: fix fd leakage in non-error case 2015-08-19 16:32:56 -07:00
rt_names.c drop unneeded include of syslog.h 2017-11-12 16:22:36 -08:00
utils.c ip: Use single variable to represent -pretty 2018-02-16 08:13:36 -08:00