cups exit on sigpipe (#16691)
Ilya Mashchenko committed
Dec 29, 2023 at 15:38 UTC
9c4483077212216dbc7517540bc9c5e728507dee
1 file changed
+7
collectors/cups.plugin/cups_plugin.c
+7
@@ -423,6 +423,13 @@ int main(int argc, char **argv) {
423
// restart check (14400 seconds)
424
if (!now_monotonic_sec() - started_t > 14400)
425
break;
426
+
427
+ fprintf(stdout, "\n");
428
+ fflush(stdout);
429
+ if (ferror(stdout) && errno == EPIPE) {
430
+ netdata_log_error("error writing to stdout: EPIPE. Exiting...");
431
+ return 1;
432
+ }
433
}
434
435
httpClose(http);