Skip to content

Commit

Permalink
cups exit on sigpipe (netdata#16691)
Browse files Browse the repository at this point in the history
(cherry picked from commit 9c44830)
  • Loading branch information
ilyam8 authored and stelfrag committed Jan 31, 2024
1 parent 6e813d9 commit 7134d09
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 7134d09

Please sign in to comment.