diff options
author | Ilya Mashchenko <ilya@netdata.cloud> | 2023-12-29 15:38:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-29 15:38:14 +0200 |
commit | 9c4483077212216dbc7517540bc9c5e728507dee (patch) | |
tree | 36301d0eac4810029aecf5895195453f241a394c /collectors | |
parent | 812eb6287404a0a644bb1f091d9a01a36a4227c3 (diff) |
cups exit on sigpipe (#16691)
Diffstat (limited to 'collectors')
-rw-r--r-- | collectors/cups.plugin/cups_plugin.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/collectors/cups.plugin/cups_plugin.c b/collectors/cups.plugin/cups_plugin.c index 0eaae4ad25..710e8f87d1 100644 --- a/collectors/cups.plugin/cups_plugin.c +++ b/collectors/cups.plugin/cups_plugin.c @@ -423,6 +423,13 @@ int main(int argc, char **argv) { // restart check (14400 seconds) if (!now_monotonic_sec() - started_t > 14400) break; + + fprintf(stdout, "\n"); + fflush(stdout); + if (ferror(stdout) && errno == EPIPE) { + netdata_log_error("error writing to stdout: EPIPE. Exiting..."); + return 1; + } } httpClose(http); |