src: use PRIu64 format
Pablo Neira Ayuso
maintainerPATCH 1/2 src: use PRIu64 format
Fix the following compilation warnings on x86_32.
datatype.c: In function ‘cgroupv2_type_print’:
datatype.c:1387:22: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Wformat=]
nft_print(octx, "%lu", id);
~~^ ~~
%llumeta.c: In function ‘date_type_print’:
meta.c:411:21: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Wformat=]
nft_print(octx, "%lu", tstamp);
~~^ ~~~~~~
%lluSigned-off-by Pablo Neira Ayuso <[email protected]>
--- src/datatype.c | 2 +- src/meta.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
src/datatype.c +1 -1
@@ -1384,7 +1384,7 @@ static void cgroupv2_type_print(const struct expr *expr,if (cgroup_path)nft_print (octx,"\"%s\"" , cgroup_path);else -nft_print (octx,"%lu" , id); +nft_print (octx,"%" PRIu64, id);xfree (cgroup_path); }
src/meta.c +1 -1
@@ -408,7 +408,7 @@ static void date_type_print(const struct expr *expr, struct output_ctx *octx)* Do our own printing. The default print function will print in * nanoseconds, which is ugly. */ -nft_print (octx,"%lu" , tstamp); +nft_print (octx,"%" PRIu64, tstamp); }static time_t parse_iso_date (const char *sym)
Signature · 1 line
2.30.2
Pablo Neira Ayuso
maintainerPATCH 2/2 datatype: skip cgroupv2 rootfs in listing
cgroupv2 path is expressed from the /sys/fs/cgroup, update listing to skip the rootfs.
Signed-off-by Pablo Neira Ayuso <[email protected]>
--- src/datatype.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
src/datatype.c +2 -1
@@ -1382,7 +1382,8 @@ static void cgroupv2_type_print(const struct expr *expr, cgroup_path =cgroupv2_get_path (SYSFS_CGROUPSV2_PATH , id);if (cgroup_path) -nft_print (octx,"\"%s\"" , cgroup_path); +nft_print (octx,"\"%s\"" , + &cgroup_path[strlen (SYSFS_CGROUPSV2_PATH ) +1 ]);else nft_print (octx,"%" PRIu64, id);
Signature · 1 line
2.30.2