Skip to content

Commit

Permalink
fix(userspace/sysdig): fixed a couple of bugs. (#1874)
Browse files Browse the repository at this point in the history
* print json root "slices" even in minimal build
* always print the json closing chars

Signed-off-by: Federico Di Pierro <[email protected]>
  • Loading branch information
FedeDP authored May 4, 2022
1 parent fd40512 commit ba2ed7d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions userspace/sysdig/csysdig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1018,6 +1018,7 @@ sysdig_init_res csysdig_init(int argc, char **argv)
}
delete mesos_api;
mesos_api = 0;
#endif // MINIMAL_BUILD

if(output_type == sinsp_table::OT_JSON)
{
Expand All @@ -1027,7 +1028,6 @@ sysdig_init_res csysdig_init(int argc, char **argv)
printf("{\"progress\": 0},\n");
}
}
#endif // MINIMAL_BUILD

//
// Start the capture loop
Expand All @@ -1038,11 +1038,7 @@ sysdig_init_res csysdig_init(int argc, char **argv)

if(output_type == sinsp_table::OT_JSON)
{
// The following line produces malformed json when using
// csysdig with the -j option. We are leaving it here,
// commented, in case it's needed for tools that consume
// csysdig's json like sysdig inspect.
//printf("]}\n");
printf("]}\n");
//printf("%c", EOF);
}

Expand Down

0 comments on commit ba2ed7d

Please sign in to comment.