diff options
author | Ilya Mashchenko <ilya@netdata.cloud> | 2023-12-29 15:38:14 +0200 |
---|---|---|
committer | Tasos Katsoulas <12612986+tkatsoulas@users.noreply.github.com> | 2024-02-06 16:33:22 +0200 |
commit | fb828e7ef3dace5a83914cf89d71ccc66bd4eeee (patch) | |
tree | d6c85dec795e40aeb7cac6c6b25f5bbf102eb717 | |
parent | f9257f72697435bc62f4481b724e3d7395571c9e (diff) |
cups exit on sigpipe (#16691)
(cherry picked from commit 9c4483077212216dbc7517540bc9c5e728507dee)
-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 827322066a..8efd32e315 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); |