Skip to content

Commit

Permalink
cups exit on sigpipe (#16691)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyam8 committed Dec 29, 2023
1 parent 812eb62 commit 9c44830
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions collectors/cups.plugin/cups_plugin.c
Expand Up @@ -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);
Expand Down

0 comments on commit 9c44830

Please sign in to comment.