Skip to content

Commit

Permalink
make debugfs exit on sigpipe (netdata#16569)
Browse files Browse the repository at this point in the history
* debugfs exit on sigpipe

* return 1 on sigpipe
  • Loading branch information
ilyam8 committed Dec 8, 2023
1 parent 0d3c9be commit 687b19f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions collectors/debugfs.plugin/debugfs_plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,13 @@ int main(int argc, char **argv)
netdata_log_info("all modules are disabled, exiting...");
return 1;
}

fprintf(stdout, "\n");
fflush(stdout);
if (ferror(stdout) && errno == EPIPE) {
netdata_log_error("error writing to stdout: EPIPE. Exiting...");
return 1;
}
}

fprintf(stdout, "EXIT\n");
Expand Down

0 comments on commit 687b19f

Please sign in to comment.