Skip to content

Commit

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

* return 1 on sigpipe

(cherry picked from commit 687b19f)
  • Loading branch information
ilyam8 authored and stelfrag committed Dec 11, 2023
1 parent 074356d commit b92efb2
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 b92efb2

Please sign in to comment.