mirror_iproute2/misc
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
..
.gitignore Add ignore files to make using git easier 2006-08-08 12:04:38 -07:00
arpd.c lib: make resolve_hosts variable common 2017-11-12 16:15:23 -08:00
ifstat.c ip: Use single variable to represent -pretty 2018-02-16 08:13:36 -08:00
lnstat_util.c lnstat_util: Make sure buffer is NUL-terminated 2017-09-01 12:10:54 -07:00
lnstat.c Replace malloc && memset by calloc 2016-07-20 12:05:24 -07:00
lnstat.h SPDX license identifiers 2017-11-24 12:21:35 -08:00
Makefile SPDX license identifiers 2017-11-24 12:21:35 -08:00
nstat.c ip: Use single variable to represent -pretty 2018-02-16 08:13:36 -08:00
rtacct.c misc: fix style issues 2016-03-21 11:56:36 -07:00
ss.c ss: fix NULL pointer access when parsing unix sockets with oldformat 2018-01-09 08:02:46 -08:00
ssfilter.h SPDX license identifiers 2017-11-24 12:21:35 -08:00
ssfilter.y ss: fix crash with invalid command input file 2017-12-18 11:18:55 -08:00