[PATCH iproute2 1/1] ip: initialize FILE pointer in ip-monitor

Subsystems: the rest

STALE3266d

2 messages, 2 authors, 2017-09-27 · open the first message on its own page

[PATCH iproute2 1/1] ip: initialize FILE pointer in ip-monitor

From: Roman Mashak <hidden>
Date: 2017-09-26 19:14:05

Since FILE *_fp was not explicitly initialized, all the consequent print_*()
calls were failing.

Signed-off-by: Roman Mashak <redacted>
---
 ip/ipmonitor.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/ip/ipmonitor.c b/ip/ipmonitor.c
index 3171d47..f4d502a 100644
--- a/ip/ipmonitor.c
+++ b/ip/ipmonitor.c
@@ -284,6 +284,9 @@ int do_ipmonitor(int argc, char **argv)
 	if (lnsid) {
 		groups |= nl_mgrp(RTNLGRP_NSID);
 	}
+
+	new_json_obj(json, stdout);
+
 	if (file) {
 		FILE *fp;
 		int err;
-- 
1.9.1

Re: [PATCH iproute2 1/1] ip: initialize FILE pointer in ip-monitor

From: Stephen Hemminger <stephen@networkplumber.org>
Date: 2017-09-27 07:36:18

On Tue, 26 Sep 2017 15:13:56 -0400
Roman Mashak [off-list ref] wrote:
Since FILE *_fp was not explicitly initialized, all the consequent print_*()
calls were failing.

Signed-off-by: Roman Mashak <redacted>
This works, but the later patch by Julien Fortien which gets rid of the
FILE * argument all together is a cleaner solution. I will skip this
patch and apply that one.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help