diff options
author | Ilya Mashchenko <ilya@netdata.cloud> | 2023-12-08 11:34:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-08 11:34:41 +0200 |
commit | 687b19fa397777498c332d8d0f8f33365286edf8 (patch) | |
tree | 5841284601dfa52adc24c6a25e62d642a34835f6 /collectors | |
parent | 0d3c9beda381fd8a6d5ff4e8f1001bc3e40ae822 (diff) |
make debugfs exit on sigpipe (#16569)
* debugfs exit on sigpipe
* return 1 on sigpipe
Diffstat (limited to 'collectors')
-rw-r--r-- | collectors/debugfs.plugin/debugfs_plugin.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/collectors/debugfs.plugin/debugfs_plugin.c b/collectors/debugfs.plugin/debugfs_plugin.c index 0a3b23db14..f693de96c1 100644 --- a/collectors/debugfs.plugin/debugfs_plugin.c +++ b/collectors/debugfs.plugin/debugfs_plugin.c @@ -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"); |